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!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
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.
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
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 ]