Rob Smyth

Tuesday, 4 September 2007

.Net Dependency Injection Frameworks - Part 2

Searching for a Dependency Injection Framework (IoC) my first pass has narrowed the contenders down to:
For my criteria and a list of other frameworks see the 'Part 1' post.

NinjectStructureMapMicroKernelPuzzle.NetImportance
License
Apache 2 OSS

essential
C#55

4
Doco34X
X4
XML config04

2
Programmatic config54

10
Constructor injection4Y

20
Method injection4?

4
Private field injection4?

3
Setter injection4
4

3
Singleton activation44

10
Transient activation44

10
Other activation45

3
Simple to use4?

20
Multiple configs45

5
Contextual binding45

4
Generic types3
4

2
NMock injection34

4
Maturity
5

4
SCORE
58
57
XX

Note: Above chart updated following Nate's comment (see comments below).

I eliminated MicroKernel as I could not find focused documentation (not related products) and what I could find turned out to be links to Porn site adverts. I gave up on Puzzle.Net as I could not find any documentation web pages.

So I'm down to Ninject & StructureMap and wondering if I ought to take a closer look at Spring.Net as it mentioned often on the web.

I will continue to update this another night. Looks like the next step is to try some sample code.

2 comments:

Nate Kohari said...

Hi Rob! Glad to see you're taking a look at Ninject. A couple of alterations to your chart: first, Ninject does support setter injection (which I've called "property injection"). Second, it does support generic types, including inference via bindings to "open" generic types. I'm working on the documentation (available at http://ninject.org/users-guide.html)... a little slow since I'm busy at my "day job" but it's coming along. :) If you have questions, feel free to post them in the Google group at: http://groups.google.com/group/ninject .

Rob Smyth said...

Thanks, I will update the chart.