• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Facade Vs business delegate

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can some one explain me the diffrence between the session facade and the business delegate patterns
Hari
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hari,
I also have the same question and i have posted this question to the local java users group mailing list. Here is the question that i have posted.
Can anyone clarify the difference between the Business Delegate and the session facade pattern. Both of them seems to be
to be quite similar to eachother. The objective of both the patterns seems to be the same
- To prevent the direct interaction of the client with the business services and reduce the coupling
between the services and clients so that the client is not vulnerable to changes in the business services.
- Another objective is to prevent multiple fine grained calls to the business services as multiple
remote calls to the services increases the network traffic and decreases the performance.
and the structure to both the patterns is
Client <---> Session Facade <---> Business Objects
Client <---> Business Delegate <---> Business Objects

The differences that i came with are ( i am not sure if they are right )
- A Session Facade is implemented as a session bean where as a Business delegate might not be a session bean.
- A Business delegate can be used as a proxy to the session facade.

I will post the summary of the responses that i get.
Ashish.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The purpose of a business delegate is to hide the EJB stuff from the client (app, JSP/Servlet). It does so by providing a simple Java interface to the client. Internally, the business delegate, wel... delegates the task to where it should go. This way, a client programmer can just think about the backend functionality as a Java class.
A session facade, however, is a component (normally a stateless session bean) that aggregates the functionality (coarse-grained) that otherwise would be aggregated in functionality on the client side. So, instead of having the client make several costly calls to different server components, the client makes one call the the session facade, who makes in his turn the different calls to the server components (this isn't so costly as the facade is on the server side itself!)
Hope this clears things up.
regards,
G�nther.
http://www.javacoding.net
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In addition to G�nther, the business delegates can hide EJB exceptions. The clients will not have any knowledge that they are talking to an EJB.
 
Author
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Simply put, a Session Facade can be used to do Business Delegate.
You can read the defination from Sun for these two patterns, http://developer.java.sun.com/developer/restricted/patterns/J2EEPatternsAtAGlance.html,
The Session Fa�ade 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 Fa�ade that provides the requested service.

Registration required to access it.
Regards
reply
    Bookmark Topic Watch Topic
  • New Topic