Service Locator
Noun · Development
Definitions
A design pattern in which objects obtain their dependencies by querying a central registry at runtime rather than receiving them via constructor injection, providing flexibility but hiding dependencies and making code harder to test — often considered an anti-pattern in favor of explicit DI.
In plain English: A central lookup directory where code goes to find the services it needs, instead of having them handed in directly.
Example: "The service locator makes it impossible to see what this class depends on without reading every method body — let's refactor to constructor injection."