Remote Versus Local Interfaces

One of the most significant improvements in the EJB 2.0 specification was the inclusion of local interfaces, as well as remote interfaces.

All the beans that you have seen so far 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. For Session beans this ability to invoke methods on a bean without regard for its location is crucial, but is less useful for Entity beans. 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 incur substantial network traffic.

A local interface ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition 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.