Core J2ee patterns, session facade: always useful javacode 9085791

Core J2ee patterns, session facade: always useful

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.

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: