views:

101

answers:

3

I am starting a new seam project targeted at a JBoss EAP server and I have very little experience with EJB3. What do I gain from using EJB3 over just using a war project with pojos and seam annotation?

A: 

This has been asked a lot on the Seam forum and there's never been any great reason to use the EAR project over WAR. On the flip-side there are several advantages to using WAR projects for example:

  • Hot deploy of code
  • Use lightweight server eg Tomcat

Most of the EJB features have been made available to WAR projects (eg. Transactions, Clustering etc)

Damo
A: 

We use EJB's extensively in our project. I tend to like normal JavaBeans better, however after two years, I finally got one of the key benefits of EJB, and that is that you can create a new implementation without changing any other code.

We upgraded a key component, but all the interface methods where the same. Thus we only needed to create a new implementation and deprecate the old one.

I also want to note that JRebel 3.0 provides hot deployment of EJB's.

Shervin
+1  A: 

Don't know Seam but you must know that in EJB3.1 specs you can put your ejb's inside a war... See http://community.jboss.org/wiki/EJB31inAS600M2 Glassfish v3 also support it i think.

I guess Tomcat supports/will support it too but anyway you can use EJB3 in Tomcat with an embedded EJB3 impl like OpenEJB ( http://openejb.apache.org/ )

Sebastien Lorber