[Last Call] Learn how to a build a cloud-first strategyRegister Now


Could you please explain service Locator Pattern

Posted on 2011-10-19
Medium Priority
Last Modified: 2013-11-24
Could you please explain service Locator Pattern
  • 2
LVL 47

Accepted Solution

for_yan earned 2000 total points
ID: 36991682

read this in wikipedia:

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

LVL 47

Expert Comment

ID: 36991708

You can even view 9 minutes video which explains Service Locator pattern

if you are interested in details about RMI, read here:

It is indeed in many cases very useful thing even irrespective of any design patterns - really useful in many cases
and very much underrated

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month18 days, 2 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question