简体   繁体   English

在接缝项目中使用EJB3可以带来什么收益?

[英]What lift do I gain from using EJB3 in my seam project?

I am starting a new seam project targeted at a JBoss EAP server and I have very little experience with EJB3. 我正在针对JBoss EAP服务器启动一个新的接缝项目,而我对EJB3的经验很少。 What do I gain from using EJB3 over just using a war project with pojos and seam annotation? 从使用EJB3到仅使用带有pojos和接缝注释的war项目,我能获得什么?

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. 不了解Seam,但您必须知道,在EJB3.1规范中,您可以将ejb置于战争之中...请参阅http://community.jboss.org/wiki/EJB31inAS600M2我认为Glassfish v3也支持它。

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/ ) 我想Tomcat也支持/也将支持它,但是无论如何,您可以在Tomcat中使用带有OpenEJB( http://openejb.apache.org/ )等嵌入式EJB3的EJB3。

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. 在Seam论坛上已经对此提出了很多要求,从来没有任何很好的理由在WAR上使用EAR项目。 On the flip-side there are several advantages to using WAR projects for example: 另一方面,使用WAR项目有很多优点,例如:

  • Hot deploy of code 热部署代码
  • Use lightweight server eg Tomcat 使用轻量级服务器,例如Tomcat

Most of the EJB features have been made available to WAR projects (eg. Transactions, Clustering etc) 大部分EJB功能已提供给WAR项目(例如,事务,集群等)。

We use EJB's extensively in our project. 我们在项目中广泛使用EJB。 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. 我倾向于更好地喜欢普通的JavaBean,但是两年后,我终于获得了EJB的主要好处之一,那就是您可以创建一个新的实现而无需更改任何其他代码。

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. 我还想指出, JRebel 3.0提供了EJB的热部署。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM