The main advantage of Dependency Injection is that it enables us to better manage future changes and complexity in our software thus helps us to make our code maintainable. Dependency Injection can be done in three ways constructor injection, method injection and property injection. The three approaches are OK if we have only one level of dependency, but think about big software's where we have chained and nested dependencies which makes it quite complicated to implement the dependency injection. That is where we have to use DI Containers. These containers will help us to map the dependencies easily when we have chained or nested dependencies.
List of popular DI Container for .Net
1. Castle Windsor
Castle Windsor is a best of breed, mature Inversion of Control Container available for .Net and Silverlight. The advantages of using Castle Windsor is that it is complete, it understands decorator and its very well documented.
Its a Dependency Injection tool for .Net that can be used to improve the architectural qualities of an object oriented system by reducing the mechanical costs of good design techniques. The good thing about StructureMap is that it works in most of the cases.
The Spring.Core assembly is the basis for Spring.Net's IoC container. It has the most comprehensive documentation among all the DI Containers.
Autofac is an Ioc container for Microsoft .Net. It manages the dependencies between classes so that applications stay easy to change as they grow in size and complexity.
The Unity Container is a lightweight, extensible dependency injection container. It facilitates building loosely coupled applications and provides developers with simplified object creation and increased flexibility by deferring component configuration to the container.
An open source dependency injector for .Net
Please Like and Share the CodingDefined Blog, if you find it interesting and helpful.