Ninject

Fork me on GitHub

Bend software to your will

Stop writing monolithic applications that make you feel like you have to move mountains to make the simplest of changes. Ninject helps you use the technique of dependency injection to break your applications into loosely-coupled, highly-cohesive components, and then glue them back together in a flexible manner.

Laugh in the face of change

Change is inevitable, so be prepared. Ninject allows you to embrace change in your software's design, so it will be easier to adjust it to match changing business needs and expectations. Then, the next time someone asks for a "small" change to your application, you can laugh in triumph rather than quivering in pain.

Use your sharpest tools

Once you break your application into components, you have to glue them back together. Rather than depending on a bunch of XML to describe how the pieces fit together, Ninject uses a powerful fluent interface. This lets you get the most out of the sharpest tools in your arsenal: your compiler and your IDE.

Write smarter software everywhere

Dependency injection isn't just for big enterprise applications; with the right framework, you can apply the practice to improve software projects of all sizes and types. Ninject was designed to be ultra-lightweight and universal. It also runs practically anywhere, including on Mono, the .NET Compact Framework, and Silverlight.

Be fast, be agile, be precise

Ninject makes dependency injection so easy that it becomes hard not to follow good practices. Once you start writing your applications with dependency injection in mind, your code will be easier to understand, easier to change, and less error-prone. Simply put, Ninject makes your application more ninja-like!

Write your code so it's flexible...

				public class Samurai {
					public IWeapon Weapon { get; private set; }
					public Samurai(IWeapon weapon) 
					{
						this.Weapon = weapon;
					}
				}
			

...and let Ninject glue it together for you.

				public class WarriorModule : NinjectModule
				{
					public override void Load() 
					{
						this.Bind<IWeapon>().To<Sword>();
					}
				}
			

Why is Ninject useful?

The vast majority of effort that is invested in software happens after the initial release. Because Ninject makes your software much easier to change, a small up-front time investment will pay huge dividends as time goes on.

What makes Ninject different?

An obsessive focus on simplicity and ease of use. We've seen the value of dependency injection, but were frustrated by the complexity of existing solutions. The goal of Ninject is make dependency injection accessible to all developers and all projects.

How much does it cost?

Ninject is and will always be free for both personal and commercial projects. It's also open source, so you can fork the code and make any changes you like. (We appreciate it if you share anything useful you come up with us, though!)