Any non-trivial EJB-based application should incorporate the session facade design pattern, since the overhead to implement it is negligible and the benefits are great, as can be read on e.g. java.sun.com:
Many business processes involve complex manipulations of business classes. Business classes often participate in multiple business processes or workflows. Complex processes that involve multiple business objects can lead to tight coupling between those classes, with a resulting decrease in flexibility and design clarity. Complex relationships between low-level business components make clients difficult to write.
The Session Facade pattern defines a higher-level business component that contains and centralizes complex interactions between lower-level business components. A Session Facade is implemented as a session enterprise bean. It provides clients with a single interface for the functionality of an application or application subset. It also decouples lower-level business components from one another, making designs more flexible and comprehensible.
The pattern basically boils down to the introduction of a session facade bean, that on the one side interfaces with the client side, and on the other side communicates with the (complicated) business logic.
More detailed information can be found in:
- Session Facade introduction, clear and to the point!
- Session facade in the Core J2EE patterns blueprints
- Facade design pattern tutorial
One thought on “Core J2ee patterns, session facade: always useful”
Thoughts on J2EE Blueprints
The folks over at Sun that created the J2EE blueprints have been successful in helping enterprises understand how to create reference implementations that support reference architectures. I asked myself, have they done a good enough job?…
Comments are closed.