Skip to main content

Ninject...

...hallelujah!


What is Ninject?! (taken from here)

"In 5 seconds

Ninject is the ninja of dependency injectors.


In 30 Seconds

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. "

One of my main bug bears with Spring.NET is the feature bloat (I really don't need 70% of the features) and the xml configuration hell (and the same can be said of many IoC/DI frameworks).

I'm using Castle/Windsor at the moment and even with this lighter weight framework the configuration bogs you down. I have my own solution using "Assemblers" to construct preset object tree implementations of interfaces - the "assemblers" themselves are created using IoC so I can swap out stuff still just not at a fine grained level. However brainer people than I have been attacking this problem and I've run across Ninject and Binsor, plus I've also given myself an idea for a tool - a UI to configure any IoC framework (using schema plugins)...

Anyway back to Ninject....sounds great, can't wait to try it out!

Comments

Nate Kohari said…
Thanks for your interest in Ninject! You're right in that it was specifically designed to avoid this kind of framework bloat that you get with some of the other DI solutions. Be sure to grab 1.0, which just came out yesterday. If you have questions as you begin to use it, feel free to post in the user's group!

Popular posts from this blog

Walk-Thru: Using Wolfpack to automatically deploy and smoke test your system

First, some history... The advent of NuGet has revolutionised many many aspects of the .Net ecosystem; MyGet, Chocolatey & OctopusDeploy to name a few solutions building upon its success bring even more features to the table. I also spotted that NuGet could solve a problem I was having with my OSS System Monitoring software Wolfpack ; essentially this is a core application framework that uses plugins for extension ( Wolfpack Contrib ) but how to unify, standardise and streamline how these plugins are made available? NuGet to the rescue again - I wrapped the NuGet infrastructure (I deem NuGet to be so ubiquitous and stable that is has transcended into the software "infrastrucuture" hall of fame) with a new OSS project called Sidewinder . Sidewinder allows me to wrap all my little extension and plugins in NuGet packages and deploy them directly from the Wolfpack application - it even allows me to issue a new version of Wolfpack and have Wolfpack update itself, sweet huh...

Configuration in .Net 2.0

11-Dec-2007 Update I've updated this post to fix the broken images and replaced them with inline text for the example xml and accompanying C# code. This post has been by far the most hit on this blog and along with the comments about the missing images I thought it was time to update it! Whilst recreating the examples below I zipped up the working source code and xml file and loaded this onto my Project Distributor site - please download it to get a full working custom configuration to play with! Just click on the CustomConfigExampleSource link on the right hand side, then the "Source" link to get the zip. We are in the process of converting our codebase to .Net 2.0. We've used Enterprise Library to great effect so decided that we should continue with this in the form of the Jan 2006 release which targets 2.0 and I've got the job of porting our Logging, Data Access etc wrappers to EntLib 2.0. ...And so far so good - the EntLib docs aren't bad and the migrati...

Deployment - the final (.Net) frontier

[Update 19th Apr 2012]  - mission complete!...v2.4.0 of Wolfpack has been released and this includes a new set of plugins that can automatically download a NuGet package then execute a deployment tool (eg: DropkicK, MSBuild.exe) - it can even run NUnit tests (via the console runner). Wolfpack v2.4.0 Wolfpack.Contrib.Deployment [Original Post] Another day, another project and deployment raises its head... Thinking that this problem must have been cracked by now I had a look around the .Net landscape and found two interesting solutions. Octopus Deploy - a .Net convention based deployment system using NuGet packages, loosely based on AppHarbour's approach. DropkicK (aka DK) - another awesome initiative from Dru Sellers et al. I like the simplicity of Octopus but also like DK's  fluent code based deployment. Hmmm, this has got me thinking - Wolfpack could easily be adapted to be used as a deployment agent. Wolfpack can already monitor a NuGet feed for new pac...