Could you please explain service Locator Pattern

Posted on 2011-10-19
Last Modified: 2013-11-24
Could you please explain service Locator Pattern
Question by:stmani2005
    LVL 47

    Accepted Solution


    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


    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now