my dog learned polymorphism*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes mock question: design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "mock question: design pattern" Watch "mock question: design pattern" New topic
Author

mock question: design pattern

ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
You are building the server side of an application and you are finalizing
the interfaces that you'll provide to the client side. But you have not yet decided
whether the business rules will be fully implemented as stored procedures
or in the java code. Which design pattern you should use to mitigate this concern?
Option 1 Business Delegate
Option 2 Facade

I picked Facade and it was wrong why ? Can't you accomplish the same thing using facade ?
Ram Dhan Yadav K
Ranch Hand

Joined: Aug 13, 2001
Posts: 321
Hi Ersin,
You can do that using facade. But when you look at J2EE design patterns architecture, it is recommended to use a Business Delegate to access SERVER SIDE apps. This will help clean separation of V from M and C of the MVC pattern. Facade and Business delegate have almost the same functionality but Business Delegate is the J2EE pattern to go with.
Correct me if i am wrong.
Ram Dhan Yadav K


Ram Dhan Yadav (SCJP, SCWCD, SCJA-I, IBM EC(483))
"We are what we repeatedly do. Excellence, then, is not an act, but a habit."
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
Thanks for the reply. I believe that you are right.

use a Business Delegate to reduce coupling between presentation-tier clients and business services. The Business Delegate hides the underlying implementation details of the business service , such as lookup and access details of the EJB architecture.
Related Patterns:
Service Locator:
This pattern may be used to create Business Delegate's Service Locator, hiding the details of implementation
Proxy:
A Business Delegate may act as a proxy , providing a stand in for objects in the business tier
Adapter:
Business Delegate may use the Adapter Pattern to provide coupling for disparate systems
Broker:
A Business Delegate performs the role of a broker to decouple the business tier objects from the clients in the other tiers

I think I fooled myself by thinking that I could do that using Facade but it is not the standard way of doing it !
Another tricky one
Session Facade

use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow . The session facade manages the business objects , and provides a uniform coarse-grained service access layers to clients
Related Patterns:
Facade :
Session Facade is based on it.
DAO :
One of the strategies for the business component in the Session Facade pattern is to use the DAO.
Service Locator:
Session Facade can use this pattern to reduce the code complexity and exploit the benefits offered by the Service Locator.
Business Delegate:
Session Facade is used by Business Delegate when the client requests access to business services .The Business Delegate proxies or adapts the client request to a session Facade that provides the requested service.
Broker:
Session Facade performs the role odf a broker to decouple the entity beans from their clients.

Quotes are from the great bookcalled Core J2EE Patterns . I just bought it and started to read it few hours ago.
[ January 08, 2002: Message edited by: ersin eser ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

On a different Topic:
Ersin, that is a very cool diagram of the DTD.
First time I have seen it visually. When you get to Architect do the same thing for the ejb.xml dtd
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Speaking of books on Patterns, are these patterns (mentioned for SCWCD exam) in the GOF book also. Not sure if I want to spend $$$ on two books... GOF and Core J2EE patterns
Thanks for any advice.
- satya


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Readers at Amazon reported that the content of the J2EE Pattern book is not very different from their J2EE pattern section online (will check up link later in office).
I am thinking of buying the Sun J2EE pattern book. Ersin: Please. Can you give any advice?

Axel
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
If you want to save some money just go ahead and do the online tutorials first that should be enough for the test . I am not a good online reader: if the content is longer than two letter size pages then I just print it out.
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Thanks Ersin.
Heres the link:
http://java.sun.com/blueprints/patterns/j2ee_patterns/index.html
They even have an active mailing list.

Axel
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Thanks, ersin and Axel.
Seems like a nice starting place. I am familiar with the Pet Store example. So I will give the online ones a shot and then go from there.
Appreciate your help.
- satya
 
Don't get me started about those stupid light bulbs.
 
subject: mock question: design pattern
 
Similar Threads
Client-Side Facades
Clarification using Session Facade
alternate design pattern for Session Facade ?
Difference between Session Facade and Business Delegate
Session Facade vs Bzns Delegate