• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

mock question: design pattern

 
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
ranger
Posts: 17347
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
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
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1072
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic