Dependency Injection

Dependency injection isn't something junkies do to themselves. It's something you can do to your code. 🙂

There are a bunch of resources on the 'net on this design pattern and the tools that support it, so I won't try to explain it in detail. For me one of the main things is that it takes the loose coupling theme and puts it on steroids, but gives you a way to manage it. The tools provide out of the box extra functionality once you've done this just by setting some configuration options, like scope control (Singleton, anyone?), caching (thread, httpcontext, others), etc.

I don't pretend to be an expert on this by any means. But of the material I've seen so far, Rob Connery's latest screencast in the MVC Storefront series is by far the best learning tool for anyone trying to figure this out:

MVC Storefront: Dependency Injection

This is a long one! I sat with Jeremy Miller (of StructureMap /CodeBetter fame) for over 2 hours, talking about DI, Singletons, kids, and other things and what came of it is, in my opinion, the best webcast in this series.

I have to agree with him on the 'best webcast' comment. It's a looong screencast, but full of geeky goodness. Well worth the time. Go get a coffee and watch it now. Right now. 🙂