Roman has posted 2 posts at DZone. You can read more from them at their website. View Full User Profile

Who Needs EJB 3.1 (lite)?

03.01.2008
| 14007 views |
  • submit to reddit

There is an interesting statement about technologies dedicated to a given profile in the J2EE 6 spec. You may have noticed the descriptions of something called EJB 3.1 (lite).

"EJB 3.1 (Lite)" refers to the idea of allowing implementations to deliver a subset of EJB 3.1. The contents of this "lite" subset are wholly undecided at this point, but as an example it might include the annotation-based programming model introduced in EJB 3.0, restricted to session beans with local interfaces (only). In other words, you could write an annotated session bean with a local interface and use it in your Web Profile-compliant product (assuming (B) is accepted, that is). But, for example, you could not write a EJB 2.1-style session bean, or an EJB 3.0 message-driven bean, or a EJB 3.0 stateful session bean with a remote interface.

It seems that someone is obsessed with EJB. I don't see any advantage of EJB 3.1 (Lite) over POJO except complications that affect everyone.

  • deployment and packaging - WAR vs EJB JAR, classloader isolation etc.
  • need for an application server - forget about Tomcat or Jetty
  • complexity overhead - you still need a lot of about EJB as a bean lifecycle, transaction, JNDI etc.

From a developer's point of view there isn't much difference between EJB full and EJB lite. Both of them bring the same level of complexity and make development more complicated. I don't think that EJB 3.1 could be useful for developers.

So, who really needs this EJB 3.1 lite?

Published at DZone with permission of its author, Roman Pichlik.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

John Denver replied on Sun, 2008/03/02 - 9:47am

EJB yuk, who still using that crap?, Give me anytime Spring and Tapestry5 it is beautiful.

Jacob Scherrer replied on Sun, 2008/03/02 - 11:51am in response to: John Denver

Right.. EJB 3.1 lite is for those of who refuse to use Spring.

 Think of someone like, oh I don't know, Gavin...

Rick Hightower replied on Sun, 2008/03/02 - 6:18pm

I personally tend to use Spring but I have already had clients who use EJB 3. I'd appreciate a light version for when I have to use it. In addition, EJB has some nice integration with WebBeans and Seam.

Here are some recent related links:

 

Kenneth Mark replied on Sun, 2008/03/02 - 9:32pm

Well I'm using EJB3 with pleasure and cannot complain a lot. 

My team use both Spring and JEE and we notice an increasing demand from

our clients to use JEE instead of other solution (maybe better or not) .

All I can say is that JEE need some improvements but IMHO it is already good

enough for serious development.

Francois Bertrand replied on Mon, 2008/03/03 - 8:18am in response to: Kenneth Mark

> Well I'm using EJB3 with pleasure and cannot complain a lot. 

+1

I enjoy using JPA in web applications.  I can choose 3 implementations, Toplink, Hibernate, OpenJPA: that's the beauty of successful standarts.

I miss transaction demarcation and Entity Manager injection.  Waiting for the new EJB 3.1 Lite, I use Google Guice and Warp-persit to provide this functionality.

 

ff aaa replied on Mon, 2008/03/03 - 12:09pm

i think EJB 3.1 lite is a good idea (as cutting the EJB 2 stuff). The  reasons author dislike the idea are generally no big deals, and alternatives such as spring has similar learning curve even worse. i see no problem using EJB3 with or without spring.

Fadzlan Bin Yahya replied on Mon, 2008/03/03 - 8:54pm

Why would someone compare POJO and EJB3?

By having EJB3, you actually have ORM, no?

Of course you can use Hibernate,Toplink, etc directly but by having EJB3, you are able to switch ORM engine with no or not much modification on the code.

 And of course you might not want to use ORM in all case, which provides a very good case for just using POJO.

 Why not compare EJB3 with EJB3.1 lite instead?

Carlos Soderguit replied on Mon, 2011/06/06 - 8:55am

Hello, I think I reach this debate too late, but... the page is still active and users can reach and read it.

First: sorry for my english!

Second: I need it! :)

EJB bring me some useful transparent enterprise features like:

  1. Scalability: by means of EJB components instances pool (stateless session beans) or state  swapping mechanism (stateful session beans)
  2. Reliability: by means of container managed distributed transactions (XA) demarcation; that mades my code less error prone
  3. Declarative security: role based authorization easily configured at business method level
  4. Productivity: these features, by default, are available simply annotating a POJO with @Stateless or @Stateful (not bad!)
  5. A simple and easy to understand lifecycle
  6. Portability by means of open industry standards (I love standards :) )
From a developers point of view, theres not difference between a POJO and an annotated POJO (only one annotation adds a lot of nitro to the component!)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.