|
|
|
|
|
by chris_wot
4733 days ago
|
|
The direct opposite of Dependency Injection is the Service Locator pattern. my_blah = container.resolve(Blah)
Notice how there is no injection of dependencies at all.I think you aught to learn what DI actually is... when you say that "the single greatest benefit (possibly, only benefit) that DI provides over other service location options" you are saying that DI is a form of service location (sic), which isn't the case. |
|
You're right in spirit, but the direct opposite of dependency injection is obviously direct dependency construction, not service location.
Service location is one step up from direct dependency construction, and can be enough for a lot of cases, but as you say, it's not dependency injection.