Hacker News new | past | comments | ask | show | jobs | submit login

> The direct opposite of Dependency Injection is the Service Locator pattern.

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.




You're right in spirit, but the direct opposite of dependency injection is obviously direct dependency construction, not service location.

Fair call!


another thing - there are multiple ways to inject dependencies - not just constructor injection.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: