Answer the question
In order to leave comments, you need to log in
How does a dependency injection container work?
Explain, please, "on your fingers" how the dependency injection container works.
I just can't get into this idea....
As I understand it:
There is some mechanism that was entrusted to monitor the creation of objects and, when necessary, slip either a newly created object or one that has already been created.
There are simple objects that do not depend on anyone.
There are complex objects that have dependencies.
Do I understand correctly that complex objects will depend on the dependency injection container?
Or does the dependency injection container, when configured, learn about everything it needs to create objects and, if necessary, issue already configured objects?
Could you give some spherical example in a vacuum?
It is interesting, first of all, to look at the EntryPoint of the program: how the injection container itself is instantiated and configured.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question