views:

162

answers:

3

There are so many IOC choices, that I don't know where to begin. I've looked at Spring.NET, Unity, Ninject, Windsor, and StructureMap so far, and I have no idea what makes one better than the other. So, what is your favorite IOC, and what feature(s) makes you use it over any other?

+2  A: 

I think more or less they have the same functionality. So it makes sense to look at:

  • Documenatation quality
  • Presense of comprehensive quickstarts
  • Is is used in other well known products
  • Is there a community around it
  • How mature is it

For example, Unity:

  • It has good documentation
  • Quickstarts are pretty good
  • It is used in Composite Application Guidance and Web Client Software Factory
  • It has community around it
  • It is only 1.2 (and 2.0 is coming) but nonetheless it is a successor of object builder
Dzmitry Huba
+4  A: 

Try to use Common Service Locator and later you will be able to switch between containers. I prefer Unity (cos of holy faith in MS =) ) and Windsor cos of it power. Ninject has a very funny documentation, if you are not going to use it you should at least read its docs and visit its site =)

Restuta
it does have the best site by far
Steve
-1 avoid Common Service Locator. Don't use your IoC/DI container as a service locator.
Mauricio Scheffer
Clarify your comment, why I should avoid using Common Service Loacator?
Restuta
+1  A: 

For new projects I use Ninject now. I like it for its "clean", modern and simple API and its fluent configuration.

Development 4.0