aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Confused in Design Patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Confused in Design Patterns" Watch "Confused in Design Patterns" New topic
Author

Confused in Design Patterns

khushhal yadav
Ranch Hand

Joined: Jun 20, 2007
Posts: 242

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


rgrds,
Khushhal
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
Maybe the following link can be helpful

Difference between Session Facade and Business Delegate


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Sundaram Karthick
Greenhorn

Joined: Jun 26, 2007
Posts: 24
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


SCJP 1.5, SCWCD 1.4, SCBCD 5
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
You can use the Business Delegate with POJOs or EJBs. Sesson Facade is used with EJBs only
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

There's no session facade pattern at the exam.


[My Blog]
All roads lead to JavaRanch
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

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.


A good workman is known by his tools.
khushhal yadav
Ranch Hand

Joined: Jun 20, 2007
Posts: 242

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confused in Design Patterns