EJB 4: the Future

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.

Advertisement

5 thoughts on “EJB 4: the Future

  1. 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()

  2. @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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s