Win a copy of Svelte and Sapper in Action this week in the JavaScript 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 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

Why 2 ServiceLocator Patterns, one for web and one for EJB?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have looked at the ServiceLocator pattern from the Sun J2EE blueprints website. I noticed that there are two ServiceLocators, one for use by the web tier and one for use by the EJB tier. I understand the principle of having only one instance of the ServiceLocator object in the web tier which is obtained by using the getInstance() method. But for the EJB tier the blueprint site says you should create a new instance of the ServiceLocator object each time you use it. I don't understand why this is so?

If anyone can shed some light on this it would be nice.

Thanks.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kindly check it out.

http://java.sun.com/blueprints/corej2eepatterns/Patterns/ServiceLocator.html

may it would be helpful. cannot explain better than this. it includes all the explaination with relevent diagrams.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saras,

Welcome to the 'ranch!

We have a naming policy which requires a display name to include a lastname so I'll have to ask you to add one.

Thanks.
 
Can't .... do .... plaid .... So I did this tiny ad instead:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic