wood burning stoves*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes ServiceLocator in PetStore Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "ServiceLocator in PetStore" Watch "ServiceLocator in PetStore" New topic
Author

ServiceLocator in PetStore

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>
Rufus BugleWeed
Ranch Hand

Joined: Feb 22, 2002
Posts: 1551
If you're using Apache/Tomcat will your web container be in a different JVM than your EJB container? Perhaps they will even be on different machines.
Edy Yu
Ranch Hand

Joined: Nov 21, 2000
Posts: 264
Rufus:
Let me summarize your explaination in my words. Let me know if I've got your point.
Web server could be in a differnt machine which makes JNDI lookups in the remote EJB container performancewise costly.
My question again will be, can I also use the cashing idea on the EJB tier? Remember even JNDI lookups in the same VM is time-consuming.
[ October 05, 2002: Message edited by: Edy Yu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServiceLocator in PetStore
 
Similar Threads
ServiceLocator in Petstore??
Service Locator
ServiceLocator in Pet Store
DTO/TO - Which Tier??
service locator pattern