Comment by oldestofsports
19 hours ago
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?
When Martin Fowler coined the term Dependency Injection [0], that was specifically for the context of container instrumentation. Merely passing service objects as constructor parameters is more akin to the Strategy pattern. At least in the Java world where it originated, “dependency injection” has always been about wiring application components and services together at runtime based on configuration, often directly injecting the dependencies into object fields via reflection, and not about statically compiled constructor invocations that happen to pass service objects.
[0] https://martinfowler.com/articles/injection.html