• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Mapping between Business deigate and Service locator

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

We know that Business deligate can make use of service locator.
Can one Business deligate can make use of multile service locators? or it should use only one sevice locator?

What is the mapping between Business Deligate and service locator?

waiting for your reply...
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Core J2EE Patterns - Business Delegate

A Business Delegate uses a component called the Lookup Service. The Lookup Service is responsible for hiding the underlying implementation details of the business service lookup code. The Lookup Service may be written as part of the Delegate, but we recommend that it be implemented as a separate component, as outlined in the Service Locator pattern



There is nothing prohibiting the "Lookup Service" from returning an object that implements an interface that actually is a composite of multiple services in which case multiple Service Locators would be necessary to implement "Lookup service".

However once it is determined that more than one client can benefit from such a "composed service" it is more likely that one would create that "composed service" as a single Business Service to prevent duplication (and to possibly act as a Facade). In that case the Business Delegate would again simply have one Service Locator as its "Lookup Service" as it would use the "composed business service" rather than composing the services itself.

So I would think that a situation where a Business Delegate uses multiple Service Locators is unlikely - and when it does happen it is probably time to refactor your services.
 
    Bookmark Topic Watch Topic
  • New Topic