Tuesday, 15 July 2014

Design Pattern - Session Facade

Session facade


Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients. 
The Session Facade design pattern abstracts the underlying business object interactions and provides a service layer that exposes only the required interfaces. Thus, it hides from the client's view the complex interactions between the participants. The Session Facade manages the interactions between the business data and business service objects that participate in the workflow, and it encapsulates the business logic associated with the requirements.
Uses
  • Provide a simpler interface to the clients by hiding all the complex interactions between business components.
  • Reduce the number of business objects that are exposed to the client across the service layer over the network.
Advantages
  • Hides complexity
  • Provides uniform service access to clients.
  • Improves network performance.
Session Façade provides coarse-grained services to the clients by hiding the complexities of the business service interactions. A Session Façade might invoke several Application Service implementations or Business Objects. A Session Façade can also encapsulate a Value List Handler. The Session Façade pattern provides a coarse-grained service of business components to remote clients. This is the same as a Façade pattern as described in GOF Design Patterns, but just provides an interface to a service instead of code. 

UML representation

Benefits

The following lists the benefits of using the Session Facade pattern:
  • Reduces the number of calls to the business component from the client
  • Reduces coupling between the tiers
  • Improves performance by reducing fine-grained calls from client
  • Provides a cleaner API to the client

When to Use

  • You should use the Session Facade pattern when:
  • You have a series of calls to make to business components from the client.

1 comment:

  1. Your Post is very useful, I am truly happy to post my note on this blog . It helped me with ocean of awareness i really appreciate it.
    Facade Consultant

    ReplyDelete