现在的位置: 首页 > 综合 > 正文

Some ebj 3.x / spring comparison from Linked In

2013年01月31日 ⁄ 综合 ⁄ 共 2020字 ⁄ 字号 评论关闭
1. Dependency Injection 
EJB3.x --Can inject anything in the container including EJBs, data sources, JMS resources and JPA resources 
Spring --Can inject almost anything including lists, maps, properties and JNDI resources. 
2.Transaction Management 
EJB3.x --Works right out of the box, but only JTA is supported 
Spring --Have to configure it to make it work, but supports a number of strategies including JTA, JDBC and Hibernate 
3. Persistence 
EJB3.x -- Tightly integrated through JPA. JPA is an API not an implementation. We could use JPA with different vendor persistence ORM implementation like Hibernate, Eclipselink (recommended by Oracle for EE6), Toplink (only available of JEE5 and less)
Spring --Framework support for JPA, Hibernate, JDBC, iBatis 
4. State management 
EJB3.x --Robust support through Stateful Session Beans and Extended Persistence Context 
Spring --Indirect support dependent on web container session management 
5. Web services 
EJB3.x --Seamless support for JAX-WS 2.0 
Spring --Poor direct support, best integration available is via configuring XFire for registered beans. 
6. Messaging 
EJB3.x --Supported out of the box through Message Driven Beans. 
Spring --Need to add configuration for message listeners. However, JMSTemplate adds nice abstraction over JMS. 
7. AOP 
EJB3.x --Simple but limited support through interceptors. 
Spring --Robust support through AspectJ and Spring AOP alliance. 
8. Security 
EJB3.x --Integrated support for declarative and programmatic security through JAAS. 
Spring --Must add and configure Acegi security. However,support beyond JAAS is possible through Acegi. 
9. Scheduling. 
EJB3.x --Simple scheduling possible through EJB Timer service 
Spring --Must add and configure Quartz for scheduling. 
10.Remoting 
EJB3.x --Integrated support through Session Bean remote interfaces. Supports distributed transactions and security. 
Spring --Remoting support may be added via configuration. Remote transactions and security are not supported. However protocols other than RMI such as Hessian and Burlap are supported.
11. Server Container Services: 
EJB3 run inside an EJB container inside an application server as middle ware components and there for provided all the application server features. 
Spring beans run inside a web server there for limited to the web server abilities.
 
【上篇】
【下篇】

抱歉!评论已关闭.