Could you please explain service Locator Pattern

Could you please explain service Locator Pattern
LVL 9
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
 
for_yanConnect With a Mentor Commented:

read this in wikipedia:
http://en.wikipedia.org/wiki/Service_locator_pattern

The service locator pattern is a design pattern used in software development to encapsulate the processes involved in obtaining a service with a strong abstraction layer. This pattern uses a central registry known as the "service locator" which on request returns the information necessary to perform a certain task.

I thnik good example would be say Java Remote Method Invocation (RMI).

RMI is very call a method of the object running on antother computer.
It has a component called RMIRegistry - objects which porovide services need to be registered wth the registry.
The c,lient then know the location of registry and the name of the service - and
registry delivers a handle to the remote object to the client

Then client uses this handle to access remote object and invoke the required ,method , execute it ion remote machine and return results to the client


0
 
for_yanCommented:

You can even view 9 minutes video which explains Service Locator pattern
http://www.youtube.com/watch?v=Ro400Zre98I


if you are interested in details about RMI, read here:
http://download.oracle.com/javase/tutorial/rmi/index.html

It is indeed in many cases very useful thing even irrespective of any design patterns - really useful in many cases
and very much underrated
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.