Difference Between ejb 2.0 and ejb 3.0Â
ejb 2.0 vs ejb 3.0
Both ejb 2.0 and ejb3.0 are the version of Enterprise Java Beans(EJB) that has broad popularity for its managed, server-side architecture for modular construction of enterprise applications. ejb2.0 and ejb3.0 both serve its users in the same way but the central point about EJB 3.0 is that it has simplified the life of developers as compared to ejb2.0. ejb 2.0 is designed under the JCP (Java Community Process), enables EJB architecture to make it easier to implement and deploy Web services applications based on Java technology. On the other hand ejb 3.0 provides a base to define the new simplified EJB API that assist an ease of development. Its additional function is the new Java Persistence API for the management of persistence and object/relational mapping with Java EE and Java SE.
ejb 2.0 uses entity beans to access the database but ejb 3.0 supports Java Persistence API for all its data needs that is generalized enough to address all portability issues. ejb 3.0 is better in performance in a way that it uses POJOs with newly introduced metadata annotation that is comparatively faster than XMLDescriptor files and JNDI Used by ejb 2.0 for object reference.
ejb 2.0 is heavy weight in terms of its requirement to write Home and Remote Interfaces and also execute standard interfaces like javax.ejb.SessionBean. ejb 3.0 does not have the restriction to use any standard interfaces. It is a simple and well configured POJO that does not need to implement container callback methods like ejbActivate, ejbLoad, ejbStore etc. POJO like EJB 3.0 entities are lightweight and it is effortless to convert from a DAO to Entity bean or vice versa.
ejb 2.0 has the limitation and inflexibility for writing database queries using EJB-QL while ejb 3.0 is facilitating with refined EJB-QL and hence database queries written are very flexible.
The security is provided in ejb 2.0 through the use of Deployment descriptors. EJB3.0 uses annotations to simplify the configuration and setup tasks for security issues. ejb 3.0 can easily be used with pluggable third party persistence providers but ejb 2.0 has limitations in this respect.
Summary:
1. ejb 2.0 uses the entity Beans for accessing the databases but ejb3.0 uses the JPA to access the database.
2. ejb.0 needs deployment description but there is no requirement of deployment description while using ejb3.0.
3. In ejb 2.0, we have to write Home and Remote interface to have access the databases while ejb3.0 does not have such constraint and is more convenient in this regard.
4. Security issues are handling through Deployment descriptors in ejb2.0 but ejb3.0 is using annotation.
5. ejb 2.0 has limitation in its pluggability with third party persistence providers.
6. In ejb3.0, Query is very flexible and several levels of joins are enabled through the refined EJB-QL.
- Difference Between VB and VBA - January 11, 2011
- Difference Between SQL and PL/SQL - January 11, 2011
- Difference Between PGP and S/MIME - January 11, 2011
Search DifferenceBetween.net :
Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.
Can anyone please share few EJB 2.0 based application that would work on JBoss..