• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Session Facade vs Bzns Delegate

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference btw the two and which is used when?
Thanx
faiza
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, in my simple terms. A Session Facade will take a complicated system, and provide a simple to use interface to that system. That is what a Facade does. As far as Business Delegate, It seperates the Gui side from the Business Implementation.
Actually I would believe you would want to use both of these in a design.
First the Business Delegate to seperate the GUI from the business Logic. The Business Delegate might have a reference to the Facade, so that the coding in the Delegate us small and simple. The Facade would make the complicated code underneath it easy, as you wouldn't need to know that part of the implementation.
Hope that helps
Mark
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Session facade is usually a stateless session bean and delegate is aplain java class. Now, think of an architecture where you have connection to Database, connection to some lagacy system, you are also using messaging to talk to other system(s) and blah blah blah. In such cases you might have multitier architecture where you might have business components, Data Access Objects and so on. Processing all this becomes very complecated. You use session facade as an entry point to your complicated tiers. Session facade might call methods on business components, or might call Data Access layer for DB operations or might do something else. Main objective of session facade is to hide underlying complexity from client (who calls session facade).
Delegate as the name suggests delegates tasks to the next layer (in many cases facade as Mark said) and hence adds a layer of abstraction (or indirection) between presentation layer and biz layer.
If all this is overwhelming, think of delegate as a door between presentation layer (servlets, JSP) and biz logic and think of session facade as a way to access complex systems of back end tier.
Client // in presentation layer
{
Delegate d = new Delegate ();
d.doMyStuff (); // this is all client as to do
}
Delegate
{
// jndi look up on facade
// facade is remote interface below
facade.bizMethodCall ();
}
Facafe
{
// complex stuff
}
Above is very rough idea. People suggest corrections if I said something wrong.
Hope this helps
Chintan
 
reply
    Bookmark Topic Watch Topic
  • New Topic