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 proje开发者_JS百科ct with pojos and seam annotation?
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/ )
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)
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.
精彩评论