aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes ServiceLocator in Pet Store Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ServiceLocator in Pet Store" Watch "ServiceLocator in Pet Store" New topic
Author

ServiceLocator in Pet Store

Edy Yu
Ranch Hand

Joined: Nov 21, 2000
Posts: 264
I am browsing Pet Store 1.3.1 from Sun.
Any body can give me a reason why they use one service locator for web tier and the other for Business/EJB tier. The only difference I noticed is the web tier service locator "cache" the references.


<i><br />Sun Certified Programmer for Java 2 Platform (SCJP)<br />Sun Certified Developer for Java 2 Platform (SCJD)<br />Sun Certified Web Component Developer for Java2 Platform, Enterprise Edition (SCWCD)<br />Sun Certified Business Component Developer for Java2 Platform, Enterprise Edition (SCBCD)<br />Sun Certified Enterprise Architect for J2EE (SCEA)<br />IBM Certified Enterprise Developer, WebSphere Studio V5.0<br /></i>
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Could it be because of (some of) the following:
a) they wanted to demonstrate two different ways of implementing the service locator pattern.
b) they didn't have the time/interest to write a configurable service locator (cache on/off)
I'm just guessing here...


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
c) They wanted to decouple the Web and EJB tiers. Therefore making it much easier to locate them on separate JVMs or even separate physical boxes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServiceLocator in Pet Store
 
Similar Threads
ServiceLocator in PetStore
Stateful session bean in session?
DTO/TO - Which Tier??
Confused about Pet Store controllers and J2EE patterns
Business Delegate/Session Facade Question