2

Possible Duplicate:
How do the major C# DI/IoC frameworks compare?

I am currently about to start a new project and I need a little help in choosing an IoC container that is robust, highly tested and is likely to be around for the foreseeable future. I have been looking at a few, particularly Spring .Net (v1.3.2), Castle Windsor and Ninject. I need to be able to convince all our developers that the container that I eventually choose will be the best for our needs, has an active following and will not die out in the next few years

I must mention that I am originally from a Java background and have used Spring in Java and in my opionion, it is the best IoC container in Java. Therefore naturally, I was first drawn to the Spring offering in .Net. I am more inclined to pick Spring .Net (just because we can transfer knowledge) but I am willing to change my mind if the other offerings (Windsor, Ninject etc) turn out to be a "better" solution. However, having done a bit of research, it seems to me that its not quite as popular in the .Net world (although it seems that most of these opinions are a little dated). But having delved a little as to why its not quite as popular, it seems to me that most people have a problem with verbose amount of XML configuration and also lack of code configuration but most people do not think that Spring.Net is technically inferior (which suggests that its technically a very good IoC continer). A little further digging shows that as of Spring .Net 1.3.2, you can configure the application context in its entirety using Spring.NET CodeConfig (my preferred method of configuraton) and this offers the same functions as configuration by XML. Hence we can eliminate XML configuration as being a problem.

Castle Windsor seems to be as mature as Spring .net and is very popular. I have done a lot of research but I cant see any advantages that it offers over Spring .Net. If anything, Spring.Net offers more in terms of functionality than castle Windsor (I might be wrong) as Spring .Net is a framework rather than simply an IoC container. Spring .Net seems to be much better documented than all the others (documenation is very important)

Ninject seems to be the new boy in town and every one seems to be raving about it however, for me, flavour of the month is not a good enough reason to pick a container that will potentially be used for years.

So my question is, why is Spring .Net not as popular than say Castle Windsor when I cant see the advantages these offer over Spring .Net and more importantly why I should choose any of the other containers over Spring .Net

All your comments are welcome however,technical reasons such as "Castle Windsor offers functionality X which is not offered in Spring .Net or is not trivial to replicate in Spring .net" will be highly more valued .

Reasons should not include the speed of the Dependency Injection of the Ioc container as that is not an issue and quite frankly if anyone is concerned about the speed of their dependency injector, then they should probably not be using an IoC container as these speeds between containers are so trivial.

Thank you all for taking the time to read this.

Community
  • 1
  • 1
quophyie
  • 75
  • 2
  • 10
  • 4
    You may think that since the above link is about a year old, it's not up to date, but the conclusions you can draw from the answers are still current. Nothing much has changed since then, other than Castle Windsor got a new release. – Mark Seemann Jan 21 '12 at 16:08
  • Why not to follow the link that @MarkSeemann provided? – Oybek Jan 21 '12 at 16:11
  • I'm currently developing a project and using Unity. I'm fully satisified with the documentation available and features it has. – Oybek Jan 21 '12 at 16:12
  • @MarkSeemann. Mark, I checked out the comparison chart at the the link provided at [How do the major C# DI/IoC frameworks compare?](http://stackoverflow.com/questions/4581791/how-do-the-major-c-sharp-di-ioc-frameworks-compare) and you suggest that Windsor is "Complete". What does "Complete" mean in this context?? Also, you suggest that Spring.Net does not support a convention based API. By that do you refer to the fluent API??. I am taking a closer look at Windsor as it looks a lot more mature and may be the better alternative to Spring.Net but as it stands at the moment, I am undecided. – quophyie Jan 21 '12 at 17:08
  • 1
    What I mean with "complete" is that I honestly can't think of a single thing that Castle Windsor can't do. – Mark Seemann Jan 21 '12 at 22:42
  • also http://stackoverflow.com/questions/21288/which-net-dependency-injection-frameworks-are-worth-looking-into http://stackoverflow.com/questions/555943/which-net-dependency-injection-framework-do-you-use http://stackoverflow.com/questions/2216684/comparing-castle-windsor-unity-and-structuremap – Mauricio Scheffer Jan 22 '12 at 02:34

0 Answers0