• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Service Locator

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are two service locators necessary - one for the web tier and one for the ejb tier? Is it possible to have only one service locator? i.e. the web service locator is also used by the SLSB to lookup the entity beans?
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, it really depends on the complexity of your system. If your business tier exposes a lot of remote session beans, it might be good if you can encapsulate some of the home object access code in the service locator on the web-tier side.

Remember EJB patterns are there to simplify the code and if you feel the ejb pattern you applied actually complicates the code, you probably should be thinking if you should apply the pattern in the first place.
[ June 30, 2005: Message edited by: Jeremy Hsu ]
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jen,

Both Sun's blueprints example at http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/app-arch/app-arch5.html and Cade's case use only one Service Locator. So, probably one is enough.

-- Dan
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sun's petsore example has 2 implementations of the service locator, one for the web which is a singleton and implements caching and the other for the business layer which is a non-sigleton and no caching. Thats probably why they have 2 service locators, otherwise a single service locator would have been fine.
 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The main goal of service locator is to hiding to process of locating business components and services. For the client like swing or applet, service locator should be on the client tier. If the service locator has been modified, all clients are forced to get the modified version. Is it bad?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic