Coding Tips & Tricks


Home > IoC

Vote for your favourite .NET DI (IoC) Framework

I've started to take a look at Dependency Injection Containers (IoC), mostly because we have started using them where I work and also just out of general interest and trying to get my mind around how they work.

Dependency Injection

From Wikipedia:

Inversion of control, or IoC, is an abstract principle describing an aspect of some software architecture designs in which the flow of control of a system is inverted in comparison to procedural programming. In traditional programming the flow is controlled by a central piece of code. Using Inversion of Control this central control as a design principle is left behind. Although the caller will eventually get its answer, how and when is out of control of the caller. It is the callee who decides how and when to answer. The principle of Inversion of Control is also known as the Hollywood Principle. Inversion of Control as a design guideline serves the following purposes:

  1. There is a decoupling of the execution of a certain task from implementation.

  2. Every system can focus on what it is designed for.

  3. Every system does not make assumptions about what other systems do or should do.

  4. Replacing systems will have no side effect on other systems.

During my investigations I came around a load of .Net IoC frameworks, a lot of them had their own pros and cons, and a lot of people were hard core supporters of certain frameworks. Currently where I work we have chosen to go with Castle Windsor, although on this website I am currently playing aroung with Ninject.

Most of these frameworks have the same common concepts, but I would like to find out what your favourite IoC frameworks are. Below is a voting panel, so please choose your favourite framework and feel free to comment on why you chose yours.

UPDATE: The voting has closed and this is how the results finished up.

Dependency Injection IOC Results

For some further reading on this topics, these are some of the links I came across whilst researching this topic:

http://en.wikipedia.org/wiki/Inversion_of_Control http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx http://www.martinfowler.com/articles/injection.html http://blog.ashmind.com/index.php/2008/08/19/comparing-net-di-ioc-frameworks-part-1 http://blog.ashmind.com/index.php/2008/09/08/comparing-net-di-ioc-frameworks-part-2

Thank you for your votes!








Comments

DBrown - 2/3/2010
Personally I think there is no best. Most of them do what you need in pretty much the same manner. Sometimes though, one might be more flexible than another.

Anton - 2/3/2010
I quite like Ninject for smaller projects, its slick and lean!

Thomas Weller - 2/5/2010
My favorite framework is not even on the list: LinFu...

Dean - 2/5/2010
@Thomas Weller - I've now added it to the list! Thanks for that .

Mike - 2/5/2010
I'd be interested in knowing the total vote count.

Hamed - 10/4/2010
There's another IOC/DI framework called "Composer" that I've contributed recently. You might as well take a look at that too: http://composer.codeplex.com/


Add your comment

300 Characters left


Please fill this in to confirm that you are human