Choosing .Net Inversion of Control container for first attempt at dependency injection

Which IoC container is easiest to start with. This probably means they have the friendliest documentation. Not too worried about the number of features.

0


source to share


6 answers


Take a look at this episode of DotNetRocks with James Kovacs: http://www.dotnetrocks.com/default.aspx?showNum=362

And this is DNRTV where he rolls his own IoC: http://www.dnrtv.com/default.aspx?showID=126



Whale

+3


source


Which is easiest depends largely on where "you come from". But if you're familiar with .Net 3.5 features like lambdas and extension methods, I'm a big fan of Autofac. Autofac makes heavy use of lambdas methods and extensions to register components instead of using xml files. This adds the benefits that you have complete type safety and also intellisence on registration. It is also a very lightweight container that I love.



Autofac is hosted in Google Code ( http://code.google.com/p/autofac/ ) and has a pretty good Wiki with documentation.

+1


source


I would start with Smart Client Software Factory or Unity

They include tons of samples as well as SCSF including some other design patterns for monkey s.

0


source


I love Castle Windsor and here you can find a three-part article that covers everything you need to get started. http://dotnetslackers.com/articles/designpatterns/InversionOfControlAndDependencyInjectionWithCastleWindsorContainerPart1.aspx

StructureMap and Unity are well documented as well. By the way, remember that almost all containers work the same way, so going from one to the other is pretty straightforward.

0


source


Do you want to learn about IoC?

If so, I recommend Oren Eini IOC in 15 lines because nothing helps you learn faster than a really simple example with full source code.

0


source


I would recommend StructureMap.

Very easy to set up and get started.

http://structuremap.sourceforge.net/Default.htm

0


source







All Articles