When it was not clear to me how to use the IoC container, I decided to stop using it because I thought it was just overuse over a simple dependency injection.
True, although even without IoC you can get into cases of excessive injection. Some time ago, I read several posts from the author of ninject, who opened my mind.
As you already know, an injector should only be used inside the context root. However, in order to avoid excessive injections, I decided to introduce an exception to the rule for the introduced factories.
In my framework, factories (and only factories) can use an injector container. Plants are bound in a container at the root of the context and therefore can be entered. Factories become real dependencies and are used to create new objects inside other objects, using an injector container to facilitate dependency injection.
sebas source share