Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Business Delegate & Service Locator

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC 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!
 
Micheal John
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.
 
Stella Kim
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: 10128
3
Eclipse IDE Mac PPC 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??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic