What is Dependency Injection and available Containers(IOC)

Posted on Updated on

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.

Dependensy Injection pattern flow diagram

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 2.0
.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.
•Register components.
•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.

Puzzle.NFactory

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.

PicoContainer.NET has originally been implemented in Java but is also available for other platforms and
languages. These are detailed in Ports.
Written by Aslak Hellesøy

References:-
Castle Windsor based on the Castle MicroKernel.
StructureMap
Spring.NET
Autofac intends to be IoC with a C# 3.0 flavor
The Unity Pattern

Advertisements

2 thoughts on “What is Dependency Injection and available Containers(IOC)

    Stalin Subash said:
    February 8, 2014 at 2:28 pm

    good bala..

    Ambikanshu said:
    February 13, 2014 at 1:30 pm

    Thanks Bala for this knowldge sharing

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s