What is Dependency Injection (DI) Design Pattern ?
Dependency injection (DI) design pattern is based on separating component behavior from dependency resolution without object intervention.
This pattern is a particular implementation of Inversion of Control, where the consumer object receives his dependencies inside constructor properties or arguments.
DI requires a framework component behind to deal with class constructor.
List of Dependency Injection Containers:-
Castle Windsor based on the Castle MicroKernel.
StructureMap is released under the permissive Apache 2 OSS license. You are free to download, modify, or redistribute StructureMap in any way you see fit without restriction.
Written by Jeremy D. Miller
Spring.NET Social supports the following runtime environments:
.NET Client Profile 3.5 and 4.0
Silverlight 4.0 and 5.0
Windows Phone 7.0 and 7.1
Written by Mark Pollack
Autofac intends to be IoC with a C# 3.0 flavor, but also supports 2.0.
Licensed under MIT, Written by Nicholas Blumhardt and Rinat Abdullin
The basic pattern for integrating Autofac into your application is:
•Structure your app with inversion of control (IoC) in mind.
•Add Autofac references.
•At application startup…
•Create a ContainerBuilder.
•Build the container and store it for later use.
•During application execution…
•Create a lifetime scope from the container.
•Use the lifetime scope to resolve instances of the components.
The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection.
Unity addresses the issues faced by developers engaged in component-based software engineering. Modern business applications consist of custom business objects and components that perform specific or generic tasks within the application, in addition to components that individually address cross cutting concerns such as logging, authentication, authorization, caching, and exception handling.
Licensed as MS-PL, Written by Chris Tavares.
Licensed under the Lesseor GPL , part of the larger Puzzle Framework
Written by Roger Alsing and Mats Helander
Ninject formerly “Titan”
Licensed under Apache 2
Was quiet, but has recently sprung back to life.
Written by Nate Kohari.
S2Container.NET is a lightweight DI container supporting AOP.
It is a port of Java version Seasar2 to .NET framework.