overwhelmed by IOC choices
There are so many IOC ch开发者_JS百科oices, 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?
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 =)
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
For new projects I use Ninject now. I like it for its "clean", modern and simple API and its fluent configuration.
精彩评论