0

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

I'd like to change my current ioc container - Spring.net to another one. Over time my web.config with spring object defnitions has greatly expanded and I think it's time to replace it with something more developer friendly and a bit more efficient (Ninject, StructureMap, etc). Could you suggest me best solution to choose? My application is asp.net web forms based (currently .NET 3.5, but in nearly future I wanna migrate it to .NET 4.0), currently I use Spring only for basic constructor and property injection, e.g. :

<object id="SampleObjectA" type="MyProject.Web.SampleAobjectA, MyProject.Web">
   <constructor-arg index="0" value="SomeValue" />
</object>

<object type="Default.aspx">
   <property name="SampleObjectA" ref="SampleObjectA" />
</object>
Community
  • 1
  • 1
Steve Macculan
  • 2,292
  • 5
  • 22
  • 32
  • Where exactly is your problem? If your question is which IoC container is best, that's likely off-topic on SO. – CodesInChaos Mar 02 '12 at 22:32
  • My question is which is the best in my case, and which will you suggest me to choose as a spring replacement. – Steve Macculan Mar 02 '12 at 22:52
  • I don't see how a spring replacement is special in any way. Every decent IoC container will support constructor and property injection. – CodesInChaos Mar 02 '12 at 23:20
  • CodeInChaos - yes, you're right, it's not anytyhing special and magic action to replace spring, my point is to replace sring in this specific use case: web forms + .net 4.0 + basic property/constructor injection. I saw many comparision but none of them fit to my simply case, and that's why I decided to ask poeple here :-) – Steve Macculan Mar 03 '12 at 10:14

2 Answers2

2

StructureMap is good, but Castle Windsor is my personal favorite - it has an awesome feature set and handles IoC very well.

eouw0o83hf
  • 9,438
  • 5
  • 53
  • 75
1

Here is a comparison of different IoC containers.

http://blog.ashmind.com/2008/08/19/comparing-net-di-ioc-frameworks-part-1/

If you have a lot of dependencies to register, you may want to look at convention over configuration support provided in StructureMap as well as Ninject.

Here is an example of how to use conventions in Ninject. StructureMap supports this also.

http://blog.decayingcode.com/post/simplifying-ninject-bindings-with-ninjectextensionsconventions

Maxime Rouiller
  • 13,614
  • 9
  • 57
  • 107
Nachiket Mehta
  • 310
  • 3
  • 15