In EJB 2.0 Entity Beans, What is the difference between the local home interface and the remote home interface?
The idea behind this is that many beans you might create are never meant to be accessed by remote clients. For example, you may program beans meant for your public interface like Order and Invoice, and you may have other helper beans which are never meant to be instantiated by remote clients, like Inventory and SalesTaxCalculator. Or you might have an entire system that takes advantage of EJB's transaction management, persistence, etc, but which has no remote (i.e., outside the current JVM) clients at all.
With EJB 1.1, you had to implement remote client views for all these beans, even if you had no remote clients. This means that your home and remote interfaces had to extend javax.rmi.Remote, which puts several restrictions on them, including:
- Any objects passed as parameters must be serializable
- Parameters are passed by value, not by reference
- Network and serialization overhead related to RMI
- Client must handle RemoteException on all method calls