Is ServiceLocator an anti-pattern?
问题 Recently I\'ve read Mark Seemann\'s article about Service Locator anti-pattern. Author points out two main reasons why ServiceLocator is an anti-pattern: API usage issue (which I\'m perfectly fine with) When class employs a Service locator it is very hard to see its dependencies as, in most cases, class has only one PARAMETERLESS constructor. In contrast with ServiceLocator, DI approach explicitly expose dependencies via constructor\'s parameters so dependencies are easy seen in IntelliSense.