Home arrow Java arrow Page 2 - Getting Started with Enterprise Java Beans (EJB) 3.0
JAVA

Getting Started with Enterprise Java Beans (EJB) 3.0


There are significant differences between earlier versions of Enterprise Java Beans (EJB) and EJB 3.0. At least some of these pertain to business components. EJB 3.0 makes it a lot easier to implement the complexity required by many enterprises in fewer steps. Keep reading to learn more.

Author Info:
By: A.P.Rajshekhar
Rating: 4 stars4 stars4 stars4 stars4 stars / 20
January 16, 2007
TABLE OF CONTENTS:
  1. · Getting Started with Enterprise Java Beans (EJB) 3.0
  2. · The difference between EJB 2.1 and EJB 3.0
  3. · Implementing an EJB Step By Step
  4. · EJB in the Real World

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Getting Started with Enterprise Java Beans (EJB) 3.0 - The difference between EJB 2.1 and EJB 3.0
(Page 2 of 4 )

The changes in EJB 3.0 that influence all of the types of EJB can be divided into three major categories. These include the deployment descriptor, implementing interfaces, and home and remote interfaces. All of these categories make extensive use of annotations, bringing down the use of XML based configuration to the minimum. The following details will make this clearer.

Deployment Descriptor

EJB 2.1 used ejb-jar.xml to specify the EJB name, the bean class name, the interfaces, the finder methods and the container-managed relationships (CMR). Apart from it, a vendor-specific deployment descriptor such as weblogic-ejb-jar.xml, jboss-ejb-jar.xml, and so on was also required to successfully deploy and execute the EJB.

In EJB 3.0 these two deployment descriptors are not required. Instead, meta data annotations are used in the bean class to handle the configurations. Every configuration parameter from bean class name to CMR can be declared using the meta data annotations within the bean class. However, to work with annotations JDK 5.0 is required because only JDK 5.0 can handle the annotations.

Implementing Interfaces

In the EJB 2.1 era, to develop Session and Entity Beans classes implement special interfaces of the javax.ejb package. Session Beans implemented the SessionBean interface and Entity Beans implemented the EntityBean interface. In EJB 3.0, however, Session and Entity Beans are Plain Old Java Objects or POJOs. They do not implement any interfaces.

Home and Remote Interfaces

In EJB 2.1 the home interface extends the javax.ejb.EJBHome interface and the remote interface extends the javax.ejb.EJBObject interface. However, in EJB 3.0 these interfaces are not required. Instead each POJO implements a Plain Old Java Interface or POJI business interface. For example, if a Session Bean is implemented as the HelloWorld POJO, it would implement HelloWorldInterface.

That covers the changes that affect all the types of EJBs. There are changes that are specific to each type that will be discussed in the future. Now that the changes have been introduced, let's see the steps involved in implementing an EJB.


blog comments powered by Disqus
JAVA ARTICLES

- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...
- Generics and Limitations in Java
- Getting Started with Java Web Development in...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials