Remote Versus Local Interfaces

One of the most significant improvements in the EJB 2.0 specification over previous versions is the inclusion of local interfaces as well as remote interfaces.

All beans that you have seen on previous days have provided only a remote interface. That is, both their home and remote interfaces have extended from javax.ejb.EJBHome and javax.ejbEJBObject, both of which, in turn, extend the java.rmi.Remote interface.

This ability to invoke methods on a bean without regard for its location is crucial for Session beans, but for Entity beans it is less useful, even positively harmful. Very often, a client must deal with many Entity beans to transact some piece of work, and if each of those Entity beans is remote, this will ...

Get Sams Teach Yourself J2EE™ in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.