Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name a simple Dependency Injection framework [closed]

I would like to try using an DI/IoC framework for the first time in a small-ish but growing project, and I don't want to disturb the project much by introducing bulky dependencies. The project itself is partly intended to be used as a library in other projects, and I don't want to trouble users with managing extra dependencies. It's also a matter of taste--I feel the size of a component should be proportional to the amount of services that I actually need. I hate to incorporate a bulky component with dependencies of its own, only to use a small part of it.

So, for .NET, is there a small DI/IoC framework that compiles to a single DLL with no dependencies other than standard libraries, that (if necessary) could be directly embedded in the assembly that uses it, and that emphasizes code-based/fluent (as opposed to XML) wiring? It must not require .NET framework 4.0.

like image 326
Qwertie Avatar asked Aug 10 '10 17:08

Qwertie


2 Answers

I feel much the same as you do about IOC frameworks. I use IOC all the time, I just don't see the need for a Framework much.

Having said that, the one I'd use if I were to pick one up would be AutoFac

It's simple, easy to grasp, and feels lightweight.

like image 127
CubanX Avatar answered Oct 21 '22 03:10

CubanX


I'd also suggest in addition to NInject that you look at Microsoft's DI Framework, Unity.

like image 26
Dave White Avatar answered Oct 21 '22 03:10

Dave White