• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I didn't say it. I'm just telling you what this tiny ad said.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic