Ninject – Dependency Injector

Ninject is the ninja of dependency injectors.Ninject is a lightning-fast, ultra-lightweight dependency injector for .NET applications. It helps you split your application into a collection of loosely-coupled, highly-cohesive pieces, and then glue them back together in a flexible manner. By using Ninject to support your software’s architecture, your code will become easier to write, reuse, test, and modify.

Example of Code:

interface IWeapon
    void Hit(string target);
class Samurai
    private IWeapon _weapon;
    public Samurai(IWeapon weapon)
        _weapon = weapon;
    public void Attack(string target)
class WarriorModule : StandardModule {
  public override Load() {
class Program
    public static void Main()
        IKernel kernel = new StandardKernel(new WarriorModule());
        Samurai warrior = kernel.Get<Samurai>();
        warrior.Attack("the evildoers");


My Rank is: 8.8

Project Home Page:
Codeplex Home Page:
Download:for .NET Framework 2.0, 3.0, 3.5 version 1.0

You dont need to reinventing the wheel 🙂


About bpostaci
Escalation Engineer in Microsoft.

Leave a Reply

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

You are commenting using your 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 )

Connecting to %s

%d bloggers like this: