Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServiceLocator Pattern

 
Prashant Purkar
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,


One can use @WebServiceRef annotation to locate WebServices, in such cases use of service locator pattern is no more required then?

Thanks
P
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Service Locator can locate any services, not limited to web services.

If we want to acquire non-container managed resources, we can use service locator pattern.
 
William Taylor
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that we need to specify patterns in component diagrams. What is the pattern for resource dependency injection in JEE 5?
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We don't need to specify patterns, we *can* specify patterns. And if we want to specify patterns I think the suitable places are in class diagrams and interaction diagrams, not in component diagrams.

If we use DI for resource injection, I think we don't need to specify further, because it's a feature of EJB 3 container.
 
Prashant Purkar
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

In such scenarios where DI is used, where there is no requirement of ServiceLocator for container managed resources.
Use of Business Delegate is also not required in this case?

Prashant

 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Business Delegate can reduce coupling. But IMO, program to interface is loosely coupling enough.
 
J J Wright
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Business Delegate provides more than just loose coupling. If you're business tier is remote you'll probably want them to perform caching or implement retry logic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic