Currently there are quite a few DI/IoC-frameworks for .NET out there (http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx). I find it quite hard to choose. Therefore I wanted to measure the public opinion and see which framework is the most popular - so please post your favorite framework here and let the people vote...
Spring.NET is one of the popular open source frameworks for Dependency Injection. Spring.NET supports . NET 4.0, . NET Client Profile 3.5 and 4.0, Silverlight 4.0 and 5.0, and Windows Phone 7.0 and 7.1.
. NET supports the dependency injection (DI) software design pattern, which is a technique for achieving Inversion of Control (IoC) between classes and their dependencies. Dependency injection in . NET is a built-in part of the framework, along with configuration, logging, and the options pattern.
Use Transient lifetime for the lightweight service with little or no state. Scoped services service is the better option when you want to maintain state within a request. Singletons are created only once and not destroyed until the end of the Application. Any memory leaks in these services will build up over time.
Constructor Injection in C# Construction injection is the most commonly used dependency pattern in Object Oriented Programming.
I'm currently using Castle.Windsor. Mainly because of the integration it has with the Rhino Tools library.
I've been watching Kzu (creator of Moq)'s screencast series as he develops Funq - a DI framework that makes extensive use of lambdas the same way Moq does. No release yet but I'm looking forward to trying it out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With