Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Session Facade Vs business delegate

Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one explain me the diffrence between the session facade and the business delegate patterns
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • 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.
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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.
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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.
Posts: 25
  • Mark post as helpful
  • send pies
  • 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,,
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.
And then the flying monkeys attacked. My only defense was this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic