views:

391

answers:

6

I am looking for the IOC/DI framework with the best documentation which would it be?

+4  A: 

Microsoft's Unity Application Block is pretty well documented.

Venr
Yes, it's well documented, but it's brittle and opaque to use, which is more important than docs, so I wouldn't use it anyway
Krzysztof Koźmic
+3  A: 

I'm currently using Unity but when I was learning IoC concept the most useful for me to learn was Ninject.

Another way to learn IoC is to try to create IoC yourself following Daniel Cazzulino's screencasts for his Funq IoC.

Here's an interesting discussion here on stackoverflow about IoC/DI.

Vadim
+1 for the link to the Funq screencasts. I found them very enlightening, and I hope Kzu gets back into the project soon.
Matt Hamilton
+5  A: 

I currently use the WindsorContainer from the Castle project, the unit tests provide an excellent source of documentation.

Rohan West
I don't typically think of unit tests as public documentation, but its a good suggestion to see how to use the library.
Aaron Fischer
Very true, they are great when you need to explore the functionallity of the framework. I have found it hard to find good documentation on many IOC containers, usually the examples are very basic.
Rohan West
+3  A: 

Poor framework with lots of docs is not going to do you much good. It's better to ask - which IoC framework is good, logical and natural to use, and has just enough docs to get you up to speed. And for that I say Castle Windsor or AutoFac.

Krzysztof Koźmic
True, but having a couple of good candidates this might be the deciding factor. Consider a team of devs that need to be first convinced and then thought to use an IoC framework. I want my co-devs to pick up a framework easily and quickly fall into the pit of success (often by reading good docs rather than asking too much questions, struggling and making bad use of something that is supposed to help you :)
Piotr Owsiak
It's a balance. I'd rather use good framework with bad docs than the opposite.
Krzysztof Koźmic
@Krzysztof Koźmic: I agree.
Piotr Owsiak
A: 

WindsorContainer, Castle. Or if you have some time, construct your own ;) Start with a dictionary for starters :D.

Unity is a good solution too! ;)

Aggelos Mpimpoudis
A: 

Well, it looks like StructureMap has decent docs: http://structuremap.github.com/structuremap/index.html.
Also I expect Unity to have pretty complete docs as it's an official MS release.

What I can tell you for sure is that Ninject has pretty much no docs at all.
Some basics are quickly covered in their GitHub's wiki, but that's pretty much it.
It's sad that despite all the hype about it this part is still missing.

Ninject is the container I started with first and it was frustrating to google things that could have been explained in a short paragraph. Truly, this is very discouraging if you have to deliver a project rather than be "wasting" time searching for some info on your container. It's my biggest complain about Ninject.

Actually I'm thinking about switching to another container for a few reasons (the docs being one of them).

Piotr Owsiak
StructureMap is a great IoC container and has pretty good documentation for version 2.5 - but if you're using the latest version (2.6+) at the time of writing the documentation is pretty much totally out of date, and as the syntax is very different it can be confusing and frustrating at times trying to work out the correct way to do things.
FinnNk
@FinnNk: I wasn't aware of that, thanks for your comment.
Piotr Owsiak