The framework picks up everything for you based on some kind of configuration (be it this code, an XML file, etc.).
This is plumbing, basically.
Many DI frameworks also include aspect-oriented programming, object lifecycle management, etc., but the basics of DI are to make your application work and work with objects that talk to each other.
Another way: the DI structure is a bit of code that calls the constructors and says that all this will be executed when it is done :)
source share