views:

856

answers:

7

What Inversion of Control Container framework would you recommend to a beginner in this area?

A: 

I have done some evaluation of the Spring.NET port. It offers AOP, config-file setup of the container, and other cool stuff. I think their site is well organized and the docs are well written.

Dave Swersky
Did you also buy a Java Spring book? or just rely on the documentation. I think I'll have to start digging in next week. Thanks.
tyndall
+3  A: 

Ninject seems to get a lot of support in these questions

http://stackoverflow.com/questions/71041/which-single-iocdi-container-would-you-recommend-using-and-why

http://stackoverflow.com/questions/21288/which-cnet-dependency-injection-frameworks-are-worth-looking-into

Vinko Vrsalovic
maybe this should be closed as a duplicate?
Mitch Wheat
It has a different gist... maybe somebody has something to say about 'newbiness', which wasn't a topic on those questions
Vinko Vrsalovic
+6  A: 

James Kovacs did a dnrtv screencast where he shows how to create your own IOC container. I recommend this to a beginner not because it's necessarily the one you want to use but because it shows the basics of why you need an IOC container and what the basic functionality is. After this, try moving on to Castle Windsor or Structure Map.

dpp
I did watch the "roll your own" screencast with Kovacs. It was good. I guess I might look a little more into the Castle stuff. I was going to take a look at the Active Record stuff too.
tyndall
+4  A: 

I recall there are some really simple tutorials from BitterCoder on Castle's Windsor which I found helpful and easy to follow.

Even if you decide to use Windsor or not, those walkthroughs should still give you a good idea of the types of features / functionality to expect from other containers.

Brendan Kowitz
A: 

I would say StructureMap. It is one of the more mature framework and really easy to use. Moreover it can integrate well with NMock to create mock objects which are invaluable for unit testing. The Microsoft supported framework is Unity so you may look at that as well.

Pratik
A: 

I agree with dp. The author of that screencast even says that you should roll your. This is so you will know how they work. Then once you have that down you can move on to the more full featured one's.

It has also been mentioned that there really isn't that a 'one IOC container to rule them all'. This is because they pretty much all have the same features. It comes down to which implementation you favor. For instance, if you are using the Enterprise Library Framework then heavily then you might favor the Unity container because you get free tie-ins to the rest of EntLib. Or maybe you are allergic to XML then you can use Ninject which has a very nice fluent interface. Each framework has its strengths and weaknesses but they will pretty much be the same from the beginners stand point.

Thedric Walker
+1  A: 

Autofac.

Lightweight, simple, fast, C# 3.0-oriented and works (for me) better in complex projects than any other IoC Container (even Windsor).

Primary features:

  • Deterministic disposal of components
  • Expression-based configuration
  • Proper support for multi-scoped component resolution
  • High performance
  • Lean codebase
Rinat Abdullin