Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Saras Moven
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.
 
Adeel Ansari
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.
 
Lasse Koskela
author
Sheriff
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic