What are the main differences between EJB 2.0 and EJB 3.0 in the orientation of an object
Major difference between EJB 2.0 and 3.0 are listed below in theory
- Elimination of home interface gives simpler lookup process in EJB 3.0 than in EJB 2.0.
- Employment of annotations makes EJB 3.0 a latest technology while the EJB 2.0 has home and remote interfaces instead of annotations.
- EJB 2.0 deploys entity beans for accessing database. EJB 3.0 has Java Persistence API to access data which is generalized to address issues of portability.
- EJB 3.0 performs better because it uses POJOs along with metadata annotation, a new introduction. The POJOs are faster than XMLDescriptor and JNDI deployed by EJB 2.0 for reference of objects. EJB 2.0 does not implement POJO.
- EJB 2.0 is heavy when it comes to writing home and remote interfaces. EJB 3.0 has no restriction on using any of the standard interfaces. It is a well configured and simple POJO which doesn’t need to execute container callback methods such as ejbActive, ejbStore, etc which are used by EJB 2.0.
- In EJB 3.0, entity bean can be effortlessly converted to DAO and vice versa. This is not possible in EJB 2.0.
Hope this might help to some extent
You are right, these are the main differences between EJB 2 and 3. Generally EJB 3 took all the best from lightweight injection frameworks like Spring and made EJB as close as it is possible to regular POJO.
However today, in the middle of 2013, why do you want to know the difference between EJB2 and EJB3? EJB2 is obsolete. Learn version 3.x, forget about the older versions. Learning EJB 2 these days is exactly like learning horse riding prior to learning car driving because people used to use horses as a transport before invention of cars.