How dependencies are resolved
There are three types of dependencies that the MicroKernel is able to handle:
- Service: a dependency on a service, usually represented by an interface.
- ServiceOverride: a dependency that was overridden by the programmer, which instructs the MicroKernel to use another component
- Parameter: a dependency on a value which is not another component instance. For example, an int or an string.
The dependencies are resolved by a single entity, the DefaultDependencyResolver which implements the IDependencyResolver interface. The implementation checks the dependency type and based on that look up the container or the configuration in order to resolve it.
One can register its own dependency resolver within the DefaultDependencyResolver. All that is need is an ISubDependencyResolver implementation which has priority whenever a dependency is being resolved. This allow customization of the dependency resolution process.
