Dan Powley
Dan Powley

Reputation: 743

Choosing a .Net Inversion of Control container for first attempt at Dependency Injection

Which IoC container is the easiest to get started with. This probably equates to which ones have the friendliest documentation. Not too worried about number of features.

Upvotes: 0

Views: 1884

Answers (6)

Keith Sirmons
Keith Sirmons

Reputation: 8411

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

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

Keith

Upvotes: 3

Peter Lindholm
Peter Lindholm

Reputation: 2520

I would recommend StructureMap.

Very easy to set up and get you started.

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

Upvotes: 0

Cameron MacFarland
Cameron MacFarland

Reputation: 71856

Are you wanting to learn about IoC's?

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

Upvotes: 0

Patrik Hägne
Patrik Hägne

Reputation: 17141

What's easiest is pretty much dependent on where "you're coming from". But if you're familíar with the .Net 3.5 features such as lambdas and extension methods I'm a big fan of Autofac. Autofac makes heavy use of lambdas and extension methods for registering components instead of using xml-files. This adds the benefit that you have full type safety and also you get intellisence when registering. It's also a very lightweight container which I like.

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

Upvotes: 1

ema
ema

Reputation: 5773

I like Castle Windsor and here you can find a three part article that describe all that you need to start. http://dotnetslackers.com/articles/designpatterns/InversionOfControlAndDependencyInjectionWithCastleWindsorContainerPart1.aspx

StructureMap and Unity are also wel documented. BTW keep in mind that almost all the Containers works in the same way, so passing from one to another is quite simle.

Upvotes: 0

Tom Anderson
Tom Anderson

Reputation: 10827

I would start with the Smart Client Software Factory or Unity

They include tons of samples, as well as the SCSF including some other design patterns to monkey with.

Upvotes: 0

Related Questions