Castle Windsor or Spring.NET - advantages and disadvantages [closed]
Asked Answered
L

3

12

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?

Leonelleonelle answered 9/1, 2010 at 10:15 Comment(0)
B
15

Neither Castle.Windsor or Spring.NET are new.

  • Castle Windsor have been around since late 2004
  • Spring.NET have been around since early 2006

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:

Brott answered 9/1, 2010 at 10:35 Comment(0)
S
5

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.

Sou answered 9/1, 2010 at 13:6 Comment(3)
If you are involved in the castle project, you must be aware the number one reason you have an active and responsive community is probably because your documentation is so horrid. Comparing documentation between the two frameworks is no contest...Spring.net has a link to a 500 page manual that is written for the current release version of the software. Figuring out how Castle works is a pain (particularly Windsor so far).Chino
@wllmsaccnt I'm new to Windsor , and I agree . Windsor documentation is horrible .Coprolalia
@ wllmsaccnt @theneoindian Two points to clarify here. One, Windsor's doco has been re-written from the grounds up since 2010. Another one, if a tool that's supposed to simplify your life requires a 500p manual you might be doing it wrong.Sou
Q
2

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.

Quetzal answered 3/2, 2012 at 15:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.