JaiswalTraining

Get the online training



Corejava Servlet Jsp  Php  Hibernate  Ajax Web Service   Ejb2.1 Ejb3.0 Struts Struts2  JPA Spring Ibatis   JSF    JSF2.0  CoreJavaDesignPattern    Jquery  Flex J2EE-Design-Patterns  Jboss7  Maven  Contact Me                                                                                                                                                                        
            IGNOU SMU PTU Project                                           Training                                                                                                                              
              

Contact Us  0091- 9210721663         jaiswaltraining@gmail.com




Corejava
Servlet
Jsp
Php
Hibernate
Ajax
Web Service
Ejb2.1
Ejb3.0
Struts  
Struts2
JPA
Spring
Ibatis
JSF
JSF2.0
CoreJavaDesignPattern
Jquery
Flex
J2EE-Design-Patterns
Jboss7
Maven







Session Fašade
  • Context
    • In multi-tiered application, business logic is encapsulated in server-side
      components. Business component expose interfaces and complexity to
      client
Problem and Forces
  • Client calls interfaces provided by Business Objects directly and this leads to tight coupling, which leads to direct dependence between clients and business objects;
  • Too many method invocations between client and server, leading to network performance problems;
  • Provide a simpler interface to the clients by hiding all the complex interactions and interdependencies between business components
  • A unified service layer must be provided for coarse-grained access by all clients, based on use cases.
  • Business Object is not protected from misuse.
Solution
  • Use a session bean as a facade to encapsulate the complexity of
    interactions between the business objects in a workflow.
The Session Fašade will be responsible for
  •  Locating, creating and modifying the business objects
  • Providing a uniform coarse-grained service access layer to clients.
  • Hiding relationships between business objects.
Structure
  • Class diagram representing the Session Facade pattern


Participants and Responsibilities

  • Sequence diagram that shows the interactions of a Session Facade with
    two entity beans, one session bean, and a DAO, all acting as participants
    in fulfilling the request from the client



Strategies

  • Stateless Session Facade Strategy
    •  If the client interaction is non-conversational (State does not need to be
      maintained between method calls), implement Session Fašade as
      Stateless session bean.
  • Stateful Session Facade Strategy
    •  If the client interaction is conversational (State does need to be
      maintained between method calls), implement Session Fašade as
      Stateful session bean

Consequences

  • Use-case approach to defining Session Fašade interface
  • Simpler, uniform interface to the clients
  • Reduce coupling between clients and business objects
  • Less network traffic
  • Coarse-grained abstraction of workflow
  • Centralize security and transaction management
Related Patterns
  • Facade [GoF]
    • The Session Facade is based on the Facade Design pattern.
  • Service Locator
    • The Session Facade is a coarse-grained object that allows encapsulation of the workflow by managing business data and business service objects interactions. The Session Facade can use the Service Locator pattern to reduce the code complexity and to exploit the benefits offered by the Service Locator.
  • Business Delegate 
    • The Session Facade is used by the Business Delegate when the client requests access to business services. The Business Delegate proxies or adapts the client request to a Session Facade that provides the requested service.