Common · Knowledge
Service locator pattern
Software pattern to dynamically control the loading of objects at run-time via a central registry object.
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.
From 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. Proponents of the pattern say the approach simplifies component-based applications where all dependencies are cleanly listed at the beginning of the whole application design, consequently making traditional dependency injection a more complex way of connecting objects. Critics of the pattern argue that it is an anti-pattern which obscures dependencies and makes software harder to test.
Text: Wikipédia, CC BY-SA 4.0. · Image: Frap (CC0) ·
Related cards
-
R★
Reactor pattern
Event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs; the service handler then demultiplexes the incoming requests and dispatches them synchronously to the associated request handlers
-
★★
Decorator pattern
Design pattern in object-oriented programming
-
★★★
Dependency injection
Technique in software engineering
-
l★
locator
System used for locating objects
-
C★
Command pattern
Behavioral design pattern
-
D★
Double-checked locking
Design pattern only locking if the locking criterion check indicates that locking is required