Programming WebLogic Enterprise JavaBeans, Version 3.0

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Understanding Enterprise JavaBeans 3.0

These sections describe the new features and programming model of EJB 3.0.

It is assumed the reader is familiar with Java programming, Java Platform, Enterprise Edition (Java EE) Version 5, and EJB 2.x concepts and features.

 


Understanding EJB 3.0: New Features and Changes From EJB 2.X

Enterprise JavaBeans (EJB) is a Java Platform, Enterprise Edition (Java EE) Version 5 technology for the development and deployment of component-based business applications. Although EJB is a powerful and useful technology, the programming model in version 2.X and previous was complex and confusing, requiring the creation of multiple Java files and deployment descriptors for even the simplest of EJB. This complexity hindered the wide adoption of EJBs.

As a consequence, one of the central goals of Version 3.0 of the EJB specification is to make it much easier to program an EJB, in particular by reducing the number of required programming artifacts and introducing a set of EJB-specific metadata annotations that make programming the bean file easier and more intuitive.

Another goal of the EJB 3.0 specification was to standardize the persistence framework and reduce the complexity of the entity bean programming model and object-relational (O/R) mapping model.

Note: This document does not discuss programming 3.0 entity beans; that information is provided in the Enterprise JavaBeans 3 Persistence guide of the BEA Kodo documentation set.

The remainder of this section describes, at a high-level, how the programming model and requirements changed in EJB 3.0, as compared to version 2.X, and lists a brief description of the the new features of EJB 3.0.

For a more detailed article that discusses these issues in depth, see An Introduction to the Enterprise JavaBeans 3.0 Specification (dev2dev Article).

Changes in the EJB Programming Model and Requirements Between Versions 2.X and 3.0

The changes between EJB 2.X and 3.0 are:

Because the EJB 3.0 programming model is so simple, BEA no longer supports using the EJBGen tags and code-generating tool on EJB 3.0 beans. Rather, you can use this tool only on 2.X beans. For information, see EJBGen Reference.

New EJB 3.0 Features

 


WebLogic Server Value-Added EJB 3.0 Features

The following features are not part of the Enterprise JavaBeans 3.0 specification, but rather, are value-added features to further simplify the EJB 3.0 programming model:

 


EJB 3.0 Examples

See Simple Enterprise JavaBeans 3.0 Examples, for simple examples of stateless and stateful session beans, interceptor classes, and how to invoke an entity. The sections in this guide reference these examples extensively. These examples are meant to simply show how to use the new EJB 3.0 metadata annotations and programming model, rather than how to program the business code of your EJB.

For a more complex example that includes actual business code, see samples directory of the WebLogic Server installation, in particular WL_HOME/samples/server/examples/src/examples/ejb/ejb30, where WL_HOME refers to the installation directory of WebLogic Server, such as /bea/wlserver_10.0.

 


Programming 3.0 Entities

This guide describes how to program 3.0 session and message-driven EJBs, and how to invoke 3.0 entities from a session EJB. It does not describe how to actually program and configure a 3.0 entity. For details instructions on that topic, see Enterprise JavaBeans 3 Persistence in the BEA Kodo documentation.


  Back to Top       Previous  Next