Reading an article from Reza Rahman in TSS about what is new in EJB 3.1, I could predict the future. Here is a code snippet from the article:
EJBContainer container = EJBContainerFactory.createEJBContainer(); Context context = container.getContext(); PlaceBid placeBid = (PlaceBid) context.lookup("java:global/action-bazaar/PlaceBid"); placeBid.addBid(new Bid("rrahman", 10059, 200.50)); container.close();
Yes, PicoContainer will be standardized as EJB 4.0!
How long is going to take to people learn that less is more?
This is obviously a joke. It isn’t really true.
5 thoughts on “EJB 4: the Future”
I don’t find this much better than what ejb3 already does.
It certainly isn’t more elegant than what grails does(using spring, jpa and hibernate under then hood)
//don’t need this EJBContainer container
//or this Context context
PlaceBid placeBid //just inject this
placeBid.addBid(Bid(“rrahman”, 10059, 200.50))
//let spring worry about this container.close()
@Waraiotoko the ejb4 container will continue to inject things. You won’t be required to do any lookups.
The code posted here is just showing the use of an EJB container outside Application Servers, as you would use PicoContainer or even Spring.
I am up for EJB
“Yes, PicoContainer will be standardized as EJB 4.0!”
Dude, I hope not!
“How long is going to take to people learn that less is more?”
They already did it! See the portable client in this tutorial:
Injection everywhere 🙂