Tuesday, July 11, 2006 11:41 AM
First, a simple definition of the SessionFacade:
Using a SessionBean as a facade shields your clients from your
business (subsystem) components, thereby making interactions
much easier for your clients, as they only need to work with
A few reasons why you would like to go for it:
- weak coupling between your clients and your business components
- it provides one place of control (in your SessionBean implementation you control with which business components must it interact)
- exposes uniform API to your clients
Please see http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html for more details regarding the SessionFacade pattern.
You can obtain a reference to another SessionBean from a SessionBean, by just creating the SessionBean instance you require via its LocalHome interface (please note this answer is with the EJB 2.1 spec in mind).