Ninject is an open source library that facilitate and improves Dependency Injection instruments available in the .NET Language widely used by Abstract for that.

(From Wikipedia)
Dependency injection (DI) is a design pattern in object-oriented computer programming whose purpose is to reduce the coupling between software components. It is similar to the factory method pattern. Frequently an object uses (depends on) work produced by another part of the system. With DI, the object does not need to know in advance about how the other part of the system works. Instead, the programmer provides (injects) the relevant system component in advance along with a contract that it will behave in a certain way.

Resolving Implementations and Singleton

Ninject is implemented in the Kernel of the application, where all the assemblies are tied together. There, we configure the safely stateless Application Services, Infrastructure Repositories and Infrastructure Providers to be loaded singleton, lowering the overhead related to resolving types and initializing them. This needs to be carefully considered by any programmer implementing the architecture and does improve performance when done correctly.

Good to Know

In very particular situations we still use the Microsoft Patterns & Practices Service Locator to resolve dependencies bound using the Ninject library.
We are studying removing such references and make exclusive usage of the Ninject.

Last edited Sep 9, 2011 at 2:16 PM by hudsonmendes, version 2


No comments yet.