• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Business Delegate & Service Locator

 
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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 Harry
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys. Can anyone provide me with a small code sample to bolster the explanations above??
 
What's gotten into you? Could it be this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic