2

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?

Steve
  • 11,763
  • 15
  • 70
  • 103
  • 2
    This is a duplicate - you'll likely find what you're interestred in at http://stackoverflow.com/questions/411660/enterprise-library-unity-vs-other-ioc-containers. (Or the blog post derived from the accepted answer here - http://elegantcode.com/2009/01/07/ioc-libraries-compared/) – Jeff Sternal Oct 09 '09 at 16:12
  • I disagree, it is a different question. I'm asking which container people are using, and what feature is the most important. The question you reference is about other containers compared to Unity – Steve Oct 09 '09 at 16:20
  • furthermore, that is just one guy's opinion. I'm trying to collect information about what people on SO are using and why they think it is the best – Steve Oct 09 '09 at 16:22
  • The title is misleading - it started out as a question about Unity but evolved into a general summary of the differences between DI frameworks. However, you're right that it doesn't really offer opinions and testimonies, so I stand corrected. Nonetheless, I think you might find a lot of useful information in them given your question. – Jeff Sternal Oct 09 '09 at 16:26
  • @Jeff, I agree that its useful, and I'm reading it now, thanks for the link – Steve Oct 09 '09 at 16:29

3 Answers3

4

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
  • 5,855
  • 33
  • 44
2

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,493
  • 20
  • 19
1

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

Development 4.0
  • 2,705
  • 1
  • 22
  • 17