A DI container follows the RRR (Register-Resolve-Release) pattern.
A DI container is a framework or a library used in order to compose the object graph of an application, creating a composition root at the application entry point and managing their lifetime. This composition root registers the objects and their abstractions that are to be resolved.
There are a lot of free DI containers, such as the following:
- Unity
- Ninject
- StructureMap
- Autofac
- Simple Injector
- DryIoc
- And many others
When creating the composition root, we configure the DI container. We can do that by using code, but also by an XML configuration file if the DI container we chose has this functionality.