logoalt Hacker News

layer8yesterday at 3:25 PM1 replyview on HN

Unless you mean just regular constructor parameters, dependency injection in the sense of a runtime dependency injection framework is the one thing I try to avoid like the plague.


Replies

oldestofsportsyesterday at 5:48 PM

That is called a "DI Container", and usually manages the objects and order of instantiation etc.

Dependency injection simply means to take objects as parameters, and not instantiate them themselves (which causes "Inversion of Control" also commonly mentioned when talking about DI). DI Containers just makes the managing of objects easier.

Avoiding it like a plague seems excessive, did you have a bad experience with them?

show 1 reply