Java
  Home arrow Java arrow Page 2 - Getting Started with Enterprise Java Beans...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Getting Started with Enterprise Java Beans (EJB) 3.0
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 16
    2007-01-16

    Table of Contents:
  • Getting Started with Enterprise Java Beans (EJB) 3.0
  • The difference between EJB 2.1 and EJB 3.0
  • Implementing an EJB Step By Step
  • EJB in the Real World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    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.

    More Java Articles
    More By A.P.Rajshekhar


       · There has been a major overhaul of EJB development process between EJB 2.1 and EJB...
       · The article describes clearly about developing the EJB but it should also provide...
     

    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...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT