The Session Facade pattern’s core application is development of enterprise apps. You can also call it a logical extension of GoF designs. The pattern encases the interactions which are happening between the low-level components, which is Entity EJB. It is implemented as a higher level component, Session EJB. After which, it is responsible for providing a common and an only interface in order for the app to function or a part of the app.
Session Facade Pattern
It also reduces or completely ends the coupling between the lower level components which in turn simplifies the design. The structure of session facade pattern is such that it has client object, session facade object, and business object. All of these have certain problems to cater and certain tasks to perform.
Spring 5 Design Pattern Book
also read:
UML Class Diagram for Session Facade
Let’s see the following UML class diagram for the Session Facade.
Use a Session Facade to encapsulate business-tier components and expose a coarse-grained service to remote clients. Clients access a Session Facade instead of accessing business components directly.
- Client -The client object, in fact, is the representation of the client of the session facade which requires an access to the business service. The client object can be another session facade in either, the same business tier or a certain business delegate in some other tier.
- Session Facade – You can also implement session facade as a session bean. It is responsible for managing the relationship between various business objects and also, providing an abstraction of a higher level to the client. The session facade object offers, the business object which is participating, a coarse-grained access. The invoke invocation represents it to the session bean.
- Business Component – The business object is more like a role object. It is responsible for facilitating in order to apply various strategies like entity beans, session beans, and a DAO. The business object is also, responsible for providing data and some services within the class diagram. In order to provide a service, the session facade object has to interact with a lot of business object instances.