The Ninja of Dependency Injectors --- Ninject

Recently I am been following Rob Conery as he explores Test Driven Development using the ASP.NET MVC framework. Rob is using a style of development known as Test First Development or Red - Green - Refactor. The timing of these articles was actually nice as I was exploring the use of the MVC framework as a possible replacement technology for my companies current web site. This all motivated me to continue down a path that I had started a few years ago, but was never able to fully follow due to corporate limitations.

While following along, I noticed that Rob was using a bit of Domain Driven Design as well as a modified (I say a needed update) of the Repository pattern. I say modified because technically your concrete repository should return entities, not IQueryable objects. Personally I like how Rob has done this and agree with why he did it. A little while ago, I was having a conversation with a former co-worker about Robs work and he brought up Inversion of Control as well as Ayende's IRepository interface. To be honest, the conversation was a bit above my understanding at that time. Well in comes Twitter. Now step forward a week, after I have started building the never version of our site loosely based on the prinicals Rob has laid out. After just having more conversations about the new site design with my friend and him showing me the ins and outs of Windsor and how we would use it, I started looking further into IoC. After getting into a political debate with Nate Kohari, via Twitter, I noticed he had created an IoC project called Ninject.

So you ask, why should I look into Ninject while there are several others out there? XML-less configuration. One of the things I cannot stand is XML configuration files. It has been my experience that they can quickly become unwieldy and unmanageable very quickly. Most use their own syntax that is more often than not does not read well and you generally have to do a lot of XML nodes. I do not profess to know anything about the rest of the IoC projects, I do know when something will work for me better than others.

The scope of this blog post is really to make people aware of this project and hopefully with help it gather a few more follower. So please head on over to the Ninject web site and check it out.
 

2 Comments

Comments have been disabled for this content.