• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ServiceLocator Pattern

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Business Delegate can reduce coupling. But IMO, program to interface is loosely coupling enough.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic