Home

 

Best practices for developing session EJBs

An EJB 3.0 developer must be adherent to the following basic rules:

Each session bean must be a POJO, the class must be concrete (therefore neither abstract or final), and must have a no-argument constructor (if not present, the compiler will insert a default constructor).

The POJO must implement at least one POJI. We stress at least, because you can have different interfaces for local and remote clients.

If the business interface is @Remote annotated, all the values passed through the interface must implement java.io.Serializable. Typically the declared parameters are defined serializable, but this is not required as long as the actual values passed are serializable.

A session EJB can subclass a POJO, but cannot subclass another session EJB.
ibm.com/redbooks