Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Mapping between Business deigate and Service locator

Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
Posts: 2968
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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