In my architecture the stateful bean is only accessesd by other (stateless) beans. That means that in principle I need only a local business interface for that bean. At the same time, a stub of that SFSB is kept on the(generally remote) controller object. My question: how does it work in this case? Can I remotely store (and re-use) a reference to a local-access stateful bean? I know that local interface is to be combined with the local home interface.
Is it the case where I need 2 pair of interfaces(remote/home and local/localhome)?
Thanks in advance for all replies [ August 22, 2005: Message edited by: dieman nambawan ]
If you want your SFSB ShoppingCartEJB implements local interfaces, you should use a SFSB as Main Controller(it caches references to the ShoppingCartEJB) with remote interfaces and all other EJB have local interfaces, similar to the Petstore strategy, a Handle to this MainControllerEJB is stored in the presentation tier HttpSession or other stuff. Using A SFSB as EJB controller (only one entry point to the Business tier) for conversational use cases isn't an overhead, it only dispatches requests to specialized SLSB and manages ShoppingCartEJB. May be, performances are better than using many remote SLSB facades.(see Core J2EEpatterns)
Marie Pierre [ August 22, 2005: Message edited by: Marie Pierre Courbevoie ]