imageProps go to Rob Conery and all of the folks at TekPub.  I think what they are doing with learning videos is a great effort, and will go a long way in spreading the word and know-how to the developer community.  Most of the videos require a subscription, with the occasional free series.  The first video in the Concepts series covers Dependency Injection and Inversion of Control.

The video introduces Ninject, “…the illegitimate brainchild of Nate Kohari.”  In all seriousness, it’s a great framework for Dependency Injection.  The first part of the video walks through a simple example, and then refactors it for Dependency Injection by extracting interfaces.  This is great, but the real trick is the Inversion of Control.  Using Ninject, a constructor can be decorated with an [Inject] attribute.  This allows Ninject to know where to use its magic.

The DI framework uses a concept of Kernels, which are instantiated with Modules, and Modules are where dependencies are defined.  In the example, a new class is created that inherits from NinjectModule.  The Load method is overridden, and some neat syntax is used to describe relationships and injections.

I won’t ruin the video, so go check it out!

Concepts: #1 Dependency Injection and Inversion of Control

Saturday, October 24, 2009 12:11:21 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Dependency Injection | Inversion of Control | Ninject | TekPub

John Nelson

mugshot I am a passionate C# Developer working in ASP.NET on an e-commerce solution for ticketing software. I work across all of the application layers, including server side functionality, and client side programming with jQuery and MS Ajax. Although my full time job is in WebForms, I spend many of my off hours working with MVC. I am especially interested in productivity and good programming practices.

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
John Nelson
Statistics
Total Posts: 25
This Year: 3
This Month: 1
This Week: 0
Comments: 1