Yesterday I was reading some articles in this site while I stumbled on an article about this two new IoC tools. Which one should I learn first? Is there some specification about which one should be used when?
Neither Castle.Windsor or Spring.NET are new.
They are two comparable DI Containers that essentially aim at providing the same services, so you don't need to learn one before the other, and neither do you need to consult any kind of specification on when to use which one.
I've been using Castle Windsor for about half a year and am generally happy with it. Spring.NET I have yet to look at, but it looks like it is very closely tied to the configuration system and doesn't support programmatic registration, and if this is true, that would be a major drawback in my eyes.
Castle Windsor and Spring.NET are not the only DI Containers available for .NET. Here's a larger list:
I'm one of the committers to Castle project (which includes Windsor) so I may be biased, but.
Windsor is very extensible, allows you to tune and bend it to your needs. It provides nice fluent registration API so that you don't have to write ton of XML. There are also tons of extensions that you can use to integrate Windsor with other frameworks, like ORMs communication frameworks (WCF, NServiceBus) etc.
Plus it has a very active and responsive community, so if you have any questions, they'll get answered fairly quickly most of the time.
I guess both are better in terms of configuration. No much difference but both are better than Unity framework. Why the hell you need marshalbyrefobject association in dependency control. But if we compare spring.net and Castle Windsor both are good. But question comes which one is complete container framework. Like we need Aspects for validation on Dependency. So winsor utility fail. I guess it’s stupid to compare String.net with Castle Windsor or anything like such because all are utilities and spring is complete container framework. And all folks who say it’s heavy please check memory leak issues with all. It’s not spring or Castle Windsor , it’s stupid way of writing code. So finally answer is if you need just DI use Windsor but if you need complete framework for any solution use spring.net.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With