Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't know if you already <a href="http://corej2eepatterns.com/Patterns2ndEd/BusinessDelegate.htm" rel="nofollow">checked this</a> out, but it's a good start.</p> <blockquote> <p>Use a Business Delegate to encapsulate access to a business service. The Business Delegate hides the implementation details of the business service, such as lookup and access mechanisms.</p> </blockquote> <p>A Service Locator encapsulates the logic required to search and/or obtain the location, restrictions and required fields for a certain service based on a general registry. A Business Delegate encapsulates a group of related services and exposes them in a cohesive way to prevent a service customer from having to search and access all the services related to a certain functionality.</p> <p>Plus, you prevent the customer from having to actually know the Service Locator and the services it should consume, leaving that to a particular Business Delegate. A client only needs that delegate to perform a group of related tasks or a task that relies in various services. </p> <hr> <p><strong>Example</strong></p> <p>A Business Delegate doesn't actually encapsulate a group of Service Locators. It provides an abstraction layer over a Service Locator to provide a cohesive subset of services. Usually there's only one instance of a Service Locator, multiple instances require an additional mapping where you should know WHICH Service Locator provides Service X, think of it as if you would need a <em>Service Locator Locator</em>.</p> <p>An example should help clarify things.</p> <p>Think about user account management. The <code>UserBusinessDelegate</code> looksup the registration service to register an user and then looksup the authentication service to allow a log in. The client only needs one Business Delegate to access those services and he doesn't need to know the id of both services.</p> <p>Those service ids are encapsulated in the <code>UserBusinessDelegate</code> avoiding the need of declaring the ids and using a Service Locator everywhere. Think about this, what would happen if one service id changes?.</p> <p>In such cases the Business Delegate in charge is updated, avoiding a direct impact for the client.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload