Deciding on Castle or Spring.Net

I’ve been comparing Spring.Net and Castle tonight to try and form an opinion about which one is better suited to use at work. I’ve used Castle MonoRail and ActiveRecord in the past and I’ve recently figured out dependency injection by using Castle Windsor, so I know what Castle offers.

After scouring the Spring.Net site I don’t see much difference in terms of functionality from either project as far my interests lie.

  • They both have an IoC container
  • They both have web frameworks (granted the frameworks are different, but they’re both better than WebForms)
  • They both have some sort of ORM capabilities

Spring.Net seems to use xml configuration a lot more than Castle and it also seems to have a ton more “stuff” in it, just based on sheer size of the documentation page. I’m not sure if this means that Spring.Net is a heavyweight framework or not. I definitely like Castle better when it comes to configuration (or lack thereof) and the availability of a programmatic API that can be used instead of xml, but that doesn’t mean that either framework has any functional difference, just a different way of getting there.

Can anyone tell me if theres something that I can do in either framework that can’t be functionally reproduced in the other? I’m mostly concerned with the Ioc, ORM, and web frameworks that each of these offer.

2 Comments

  1. Alex Henderson said,

    Wrote on November 8, 2007 @ 4:39 am

    Personally having worked with both containers, I think the MicroKernel / Windsor architecture in Castle is a lot more flexible / powerful then the spring equivalent… Give both a try obviously, but in my experience the Windsor container is probably one of the most well designed IoC containers written, in any language.

    I think the Castle project actually has more “in it” then Spring.Net, especially if you include Contrib – it’s just poorly documented in many cases, or documented in blog posts… Though I haven’t had a play with some of the new features added to spring in the last 6 months.

  2. ben said,

    Wrote on November 8, 2007 @ 9:20 am

    Thanks for the feedback Alex. I agree with you on the overall design and usability of Windsor, I spent yesterday swapping Windsor out with Spring.Net and it wasn’t as easy to figure out as it should have been.

    Unfortunately you hit the nail right on the head – Spring.Net is very well documented and thats a major selling point when making a case for either framework.

Comment RSS