• 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

Confused in Design Patterns

 
Ranch Hand
Posts: 242
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..

Sometimes, I find it difficult to choose between Fascade and Business Delegate design patterns. Both are used to reduce coupling between business tier and presentation tier.

Regards,
Khushhal
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe the following link can be helpful

Difference between Session Facade and Business Delegate
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Access to business component for the view are directed through the business delegate to session facade which access the required business components. Although both business deligate and session facade access service locators and both belong to Business tier - Business delegate is more of a presentation interface to access business components through the session facade.
The main purpose of BD is "You want to hide clients from the complexity of remote communication with business service components. " (from Core J2EE problem statement).Refer Business deligate. Hope this answers your question
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the Business Delegate with POJOs or EJBs. Sesson Facade is used with EJBs only
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no session facade pattern at the exam.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's say you mail your resume/CV to a big company. The post office is like a business delegate business because it abstracts away the remoteness between you and the company... ok my analogy isn't perfect because you have to write the JNDI, er, address on the envelope and the post office might give you a RemoteException, er, Return to Sender - No Address Found. A real business delegate would know the address (or ask a service locator) and will usually wrap a RemoteException in a custom business exception.

OK, so the company received your resume/CV and it goes directly to HR because HR is the session facade. The HR rep will communicate with the IT departments, CEO, and whoever else needed in deciding whether to bring you in for an interview. Your resume/CV does NOT go directly to any other business components, er, employees! Not even if those people are needed to make the hiring decision! This is great because the other employees don't need to know how to be HR people in addition to their other duties. We keep a separation of concerns and so the resource manager only needs to know: "I need a good SCWCD programmer that understands business delegates and session facades!" And HR knows right where to find one.
 
khushhal yadav
Ranch Hand
Posts: 242
Mac Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok Marc

Business Delegate is all about hiding the remoteness of the Objects/Components.
Even if the components you are accessing are remote, but they appears to be local to you.
And it does all this with the help of Service Locator (an another design patter) which in turn makes use of JNDI, RMI or other registeries.

And Session Fascade just adds an another layer between the interface and implementation to keep them seperate.

Mark, am I right?

Regards,
Khushhal
reply
    Bookmark Topic Watch Topic
  • New Topic