Home

 

EJB 3.0 simplified model

There are many publications that discuss the complexities and differences between the old EJB programming model and the new. For this reason, in this book, we focus on diving right into the new programming model. To overcome the limitations of the EJB 2.x, the new specification introduces a really new simplified model, whose main features are as follows:

Entity EJBs are now JPA entities, plain old Java objects (POJO) that expose regular business interfaces (POJI), and there is no requirement for home interfaces.

The requirement for specific interfaces and deployment descriptors has been removed (deployment descriptor information can be replaced by annotations).

A complete new persistency model (based on the JPA standard) supersedes EJB 2.x entity beans (see Chapter | 2, Persistence using the Java Persistence API (JPA)).

An interceptor facility is used to invoke user methods at the invocation of business methods or at life cycle events.

Default values are used whenever possible ("configuration by exception" approach).

There are now reduced requirements for the usage of checked exceptions.

Figure | 4-1 shows how the model of J2EE 1.4 has been completely reworked with the introduction of the EJB 3.0 specification.

Figure 14-1 EJB 3.0 architecture

In the following sections, we introduce the following features.

ibm.com/redbooks