• 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

Business Delegate & Service Locator

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

I'm little bit baffled with what exactly are business delegates and service locators with respect to the jsp views. Is there any explanation given anywhere?? The Head First explanation is too high for me...Anyone please help!
 
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Business Delegate nothing but hiding the complexity of JNDI lookup.

Since our Model and Bean are at remote place, it will be registered with JNDI registry. Whoever wants to access this model has first to search it in the JNDI registry. If this searching of JNDI is written in the controller, we have to handle remote exceptions and other. And also we don't know whether the required model is at remote or local. Sometimes it can be local and sometimes it can be remote..

So all this stuff of coding we have to written in the controller. As per the design pattern principle, cohesion is important/one of the priciple of design pattern..

Instead of writing all this in the controller, we will write it in a separate object..that is business delegate

By doing this: We are hiding the complexity of searching the JNDI in the controller and also it is well cohesive.. that is business delegate is designed for this particular task of searching the model in JNDI.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding is:
'Service Locator' is to look up JNDI to locate the registered remote Model and Bean. One of the benefit of 'Service Locator' is minimizing the impact on the web tier when remote component change LOCATIONS or CONTAINERS.

And use 'Business Delegate' to interact indirectly with the remote Model and Bean. The goal of 'Business Delegate' is to minimize the coupling between presentaion-tier client and the business service by hiding the underlying implementation details of the service, and handles the exception from the business services...
As an example, the Business Delegate can be used to perform any retry or recovery in case the business service fails without impacting the client.

Well....
please correct me if anything wrong..
[ January 23, 2007: Message edited by: Stella Kim ]
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys. Can anyone provide me with a small code sample to bolster the explanations above??
 
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic