JAVA Means DURGA SOFT
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786   Page 1
                                   JAVA Means DURGA SOFT
                                      Session Facade
Problem:
       If remote client wants communicate with multiple business components then it has to
use multiple network and remote calls to interact with these multiple business components
that means more network calls will be there between client & business component.
       Ex.EJB clients (swing, servlets, JSPs etc) can access entity beans directly. If EJB clients
access entity beans directly over the network, it takes more network calls and imposes network
overhead. The following figure illustrates this process:
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786            Page 2
                                  JAVA Means DURGA SOFT
Here in the above figure, the servlet calls multiple entity beans directly to accomplish a
business process, thereby increasing the number of network calls.
Solution: Work with Session Façade design pattern. Session façade is a dummy business
component that resides at server side, receives remote call from client and passes that call to
multiple business components of server side locally.
       The solution for avoiding number of network calls due to directly accessing multiple
entity beans is to wrap entity beans with session bean (Facade). The EJB client accesses session
bean (Facade) instead of entity beans through coarse grained method call to accomplish a
business process.
       The following figure illustrates how the session facade (session bean) acts as an
interceptor between client and entity beans:
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786          Page 3
                                  JAVA Means DURGA SOFT
Here the client makes only one coarse grained method call to session bean (facade) to process
a business method instead of placing fine grained calls to entity beans. The session bean in turn
calls entity beans to process client request. Entity beans can be made local by implementing
EJB2.0 local interfaces to reduce remote overhead between session facade and entity beans.
Therefore the session facade reduces the network traffic and increases performance.
Note: Here the stateless bean component i.e. acting as session façade does not contain any
business logic but contains logic to communicate with other business components by receiving
calls from the remote client.
Note:
    Synchronous Communication:           If client is waiting or sitting idle to perform next
        operation until the given request related response comes to client from the server
        application then it is called as Synchronous Communication ex: Phone Call
    Asynchronous Communication: If client is free to generate next request or to perform
        client side operations without waiting for given request related response from the
        server application then it is called as Asynchronous Communication ex: SMS or Chatting
        Features
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786           Page 4
                                  JAVA Means DURGA SOFT
DURGA SOFTWARE SOLUTIONS ,202 HUDA Maitrivanam, Ameerpet , Hyd. Ph: 040-64512786   Page 5