Service locator pattern

From Wikipedia, the free encyclopedia

The Service Locator Pattern is a design pattern used in software development to separate the processes involved in obtaining a service.

Contents

[edit] Intent

Encapsulate the details required in obtaining a service. Related to Dependency_inversion_principle.

[edit] Motivation

In a multi-tier architecture, finding the adequate service through a naming service (e.g. JNDI) is made many times through the client application.


[edit] Participants

[edit] Collaborations

[edit] Consequences

[edit] Implementation

[edit] Sample Code

See http://java.sun.com/blueprints/corej2eepatterns/Patterns/ServiceLocator.html

[edit] Known Uses

[edit] Related Patterns