Dependency Injection Frameworks


Performing manual dependency injection (like we are above) works fine, but does become harder to maintain as the number of dependencies and components in an application increases.

Several dependency injection frameworks exist for .NET that can help provide even more dependency management flexibility.

These frameworks, also sometimes called “Inversion of Control” (IoC) containers, provide mechanisms that enable an additional level of configuration support for specifying and passing dependencies to objects at runtime (most often using constructor injection).

Some of the more popular OSS Dependency Injection / IOC frameworks in .NET include:

  1. AutoFac
  2. Ninject
  3. Spring.NET
  4. StructureMap
  5. Windsor

ASP.NET MVC exposes extensibility APIs that enable developers to participate in the resolution and instantiation of controllers, and which enables Dependency Injection / IoC frameworks to be cleanly integrated within this process.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s