Back from a vacation from ‘im Don’t Be Afraid to Drop the SOAP
Oct 04

Lightweight containers vs. EJB: Don Box, Ted Neward, Rod Johnson, and more

EJB, Java, Lightweight Containers, Tech Add comments

A blog discussion has started on the subject of lightweight containers, and somehow changed to OR mappers at the end :)

Neward on Crupi

What is the state of the enterprise Java world, anyway?

I think there are some KEY differences with the recent move to lightweight containers.

The various tools that I seem to prefer these days have one thing in common:

Transparency

I think this is a huge thing. I think that so many projects have gotten away from core OO practices (and OO doesn’t mean distributed objects Ted!) because they were stuck with crappy EJBs. These applications were built using “patterns” of:

Stateless Session Bean – Entity Beans – which use DTOs

This isn’t OO. This is RPC. The entity beans often had simple mapping, and don’t allow for inheritence. DTOs are evil as they are a duplicate layer of structs that you are throwing around.

Note that I am talking about an application that isn’t a service. I am talking about building an internal application first, using good OO practices, and THEN you can lay on the service layer to allow for external stuff.

So, back to transparency.

IoC Containers

I can finally write code that is just POJO based. There are no extension points to the framework. I am not stuck extended evil EJB interfaces and classes, having to create “home” interfaces and such. This all gets in the way. Not only does it get in the way but not I am totally tied up in knots.

With a container like Spring you look at my code and would have no idea if I am using it! What if I want to move to something else like Pico or Hivemind? I can. My core business logic is in tact and I can go about my way of moving. I don’t sit around crying because I have to munge my logic from the coupling with the framework! I love it.

JDO, Hibernate, etc

I like transparent persistence (not that it is truly transparent due to the OO-DB mismatch… but it gets close). Once again, I can develop a full, rich, domain object model. The model can even have inheritence and interfaces, and maybe people will put in real business methods that do things instead of just gets and sets (gasp!).

Now with a marriage of these technologies I have a clean domain object model (transparent persistence), and clean services (lightweight container). Testing IS a lot nicer too in my experience Ted. You don’t need to run around finding or building bloody mocks for the environment.

2PC

I do agree with Ted in that EJB is good for some things, such as 2PC and Message Driven Beans. There is going to be a kick arse way to do MDB in Spring coming up soon, so that need will go away. What about 2PC?

Well, a couple of things can happen:

a) The lightweight container can support them
b) You use an EJB when you need to do 2PC! One nice thing about the lightweight containers is that they can be used WITH EJB too :) However, HOW many applications need 2PC? 2%? And then within those applications, how many of their transactions need to be 2PC?

If you can’t see that Spring isn’t nicer than EJB? Ouch. You must like eating the elephant ;)

9 Responses to “Lightweight containers vs. EJB: Don Box, Ted Neward, Rod Johnson, and more”

  1. Don Box's Spoutlet Says:

    re: Neward on Crupi

  2. Dilip Says:

    “However, HOW many applications need 2PC? 2%? And then within those applications, how many of their transactions need to be 2PC?”

    Dion.. That statement above seems awfully backwards to me. An application decides whether it needs local or distributed transactions first. If it needs the latter then 2PC is a foregone conclusion. The real question you need to ask is whether running a distributed transaction is that prevelant. COM+ had this bad habit of starting a distributed transaction as soon as you declaratively mark a component as requiring transaction even if you operate on only one RM.

  3. Dion Says:

    Prashant -

    I agree with you there. Especially, now with JOTM, we have a solid open source JTA implementation that we haven’t had before.

    I just meant that EJB is an option with 2PC.

    I agree with you 100% though :)

    Dion

  4. Heloise Says:

    freewebpages [url=http://freesexvidslists1.za.pl]freewebpages[/url]
    free firewall softwares [url=http://freesexvidslists2.za.pl]free firewall softwares[/url]
    asian massage parlor [url=http://freesexvidslists2.za.pl]asian massage parlor[/url]
    download simcity 3000 [url=http://freesexvidslists2.za.pl]download simcity 3000[/url]
    aolim download [url=http://freesexvidslists2.za.pl]aolim download[/url]
    free gallery naturism [url=http://freesexvidslists2.za.pl]free gallery naturism[/url]
    www miniclip ro [url=http://freesexvidslists2.za.pl]www miniclip ro[/url]
    houston chronicle classifieds [url=http://freesexvidslists1.za.pl]houston chronicle classifieds[/url]
    download music softwear [url=http://freesexvidslists1.za.pl]download music softwear[/url]
    britneyspears.com [url=http://freesexvidslists1.za.pl]britneyspears.com[/url]
    clipart monkeys [url=http://freesexvidslists2.za.pl]clipart monkeys[/url]
    rap video auditions [url=http://freesexvidslists2.za.pl]rap video auditions[/url]
    border cliparts [url=http://freesexvidslists2.za.pl]border cliparts[/url]
    free baby cliparts [url=http://freesexvidslists1.za.pl]free baby cliparts[/url]
    comprehension worksheets free [url=http://freesexvidslists2.za.pl]comprehension worksheets free[/url]
    free poncho patterns [url=http://freesexvidslists1.za.pl]free poncho patterns[/url]
    trisha video clip download [url=http://freesexvidslists1.za.pl]trisha video clip download[/url]
    free popup stoppers [url=http://freesexvidslists2.za.pl]free popup stoppers[/url]
    cock info large massive remember [url=http://freesexvidslists1.za.pl]cock info large massive remember[/url]
    soundmax downloads [url=http://freesexvidslists1.za.pl]soundmax downloads[/url]
    freezers upright [url=http://freesexvidslists1.za.pl]freezers upright[/url]
    freewebs.com [url=http://freesexvidslists1.za.pl]freewebs.com[/url]
    free region rj1500dvx [url=http://freesexvidslists2.za.pl]free region rj1500dvx[/url]
    9 free grade grammar home school worksheets [url=http://freesexvidslists2.za.pl]9 free grade grammar home school worksheets[/url]
    freedmen bureau [url=http://freesexvidslists2.za.pl]freedmen bureau[/url]
    hairy pusy movie [url=http://freesexvidslists2.za.pl]hairy pusy movie[/url]
    dxball download [url=http://freesexvidslists2.za.pl]dxball download[/url]
    livewire music download free [url=http://freesexvidslists1.za.pl]livewire music download free[/url]
    free calligraphy alphabet [url=http://freesexvidslists1.za.pl]free calligraphy alphabet[/url]
    freehotpics.com [url=http://freesexvidslists1.za.pl]freehotpics.com[/url]

  5. Maxx Says:

    the spongebob squarepants movie big romance [url=http://freesexvidslists1.za.pl]the spongebob squarepants movie big romance[/url]
    toms movie [url=http://freesexvidslists2.za.pl]toms movie[/url]
    butterfly+screensaver [url=http://freesexvidslists1.za.pl]butterfly+screensaver[/url]
    download fat man scoop [url=http://freesexvidslists1.za.pl]download fat man scoop[/url]
    fulldvd marvel nemesis ps2 usa [url=http://freesexvidslists2.za.pl]fulldvd marvel nemesis ps2 usa[/url]
    telugu song download [url=http://freesexvidslists2.za.pl]telugu song download[/url]
    free musicc videos [url=http://freesexvidslists1.za.pl]free musicc videos[/url]
    cassidy murder trial [url=http://freesexvidslists2.za.pl]cassidy murder trial[/url]
    free printable kids chore charts [url=http://freesexvidslists1.za.pl]free printable kids chore charts[/url]
    assman [url=http://freesexvidslists2.za.pl]assman[/url]
    free printables for scrapbooking [url=http://freesexvidslists2.za.pl]free printables for scrapbooking[/url]
    hallmark ecard free [url=http://freesexvidslists2.za.pl]hallmark ecard free[/url]
    free jenna lewis video [url=http://freesexvidslists2.za.pl]free jenna lewis video[/url]
    data1.msi downloads [url=http://freesexvidslists2.za.pl]data1.msi downloads[/url]
    clipart footballs [url=http://freesexvidslists1.za.pl]clipart footballs[/url]
    free patterns crochet baby blankets [url=http://freesexvidslists2.za.pl]free patterns crochet baby blankets[/url]
    phim nguoi lon for free [url=http://freesexvidslists2.za.pl]phim nguoi lon for free[/url]
    beginning exorcist movie [url=http://freesexvidslists1.za.pl]beginning exorcist movie[/url]
    biomass energy program regional southeast [url=http://freesexvidslists2.za.pl]biomass energy program regional southeast[/url]
    mugen character download [url=http://freesexvidslists2.za.pl]mugen character download[/url]
    limewire basic free [url=http://freesexvidslists2.za.pl]limewire basic free[/url]
    free dvd burning softwere [url=http://freesexvidslists2.za.pl]free dvd burning softwere[/url]
    swallowtail butterfly [url=http://freesexvidslists2.za.pl]swallowtail butterfly[/url]
    medicalfetish [url=http://freesexvidslists2.za.pl]medicalfetish[/url]
    borders clipart [url=http://freesexvidslists1.za.pl]borders clipart[/url]
    www miniclips.com [url=http://freesexvidslists1.za.pl]www miniclips.com[/url]
    freeantivirus software [url=http://freesexvidslists2.za.pl]freeantivirus software[/url]
    annual credit free report.com [url=http://freesexvidslists1.za.pl]annual credit free report.com[/url]
    downloaddvd shrink [url=http://freesexvidslists1.za.pl]downloaddvd shrink[/url]
    english mp3songs download [url=http://freesexvidslists1.za.pl]english mp3songs download[/url]

  6. Anonymous Says:

    http://www.humanmetrics.com/cgi-win/JTypes1.htm

  7. Anonymous Says:

    http://www.humanmetrics.com/cgi-win/JTypes1.htm

  8. nixo Says:

    If you can’t see that Spring isn’t nicer than EJB? Ouch. You must like eating the elephant ;)

    1) I think you got that backwards.
    2) trading one bit of complexity for another less complex bit of complexity doesn’t sound like much of a win to me.
    What is wrong with POJO. The simplest servlet engine and a library of useful classes is all I’ve ever needed. It’s simple and fast isn’t complex (unless you make it so) and doesn’t involve related code being in lots of different places.
    OO sounds great on paper, but in reality all it means is that one logical process is spread over multiple class files instead of just one.
    I never understood how that was better.
    I also never quite got why java is better than C++.

  9. Ted Neward Says:

    nixo,
    You don’t understand why “java is better than C++”? Moron.

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What are the first four letters in the word British?