Over the past few days, I spent some time recording the experience of building a dependency injection container using test driven development. It was a cool experience for me, and I hope you find the screencasts useful.
Here are all the episode links:
- Part I: selecting a high performance approach and building the basics with few lines of code. View | Download
- Part II: adding support for passing constructor arguments to resolved instances. View | Download
- Part III: adding named services and refactoring to improve code. View | Download
- Part IV: add support for instance reuse. View | Download
- Part V: adding support for container hierarchies. View | Download
- Part VI: adding deterministic disposal of container hierarchies and instances created by them. View | Download
- Part VII: polishing a fluent API. View | Download
- Part VIII: adding support for initializer functions. View | Download
- Part IX: how well does it perform really? View | Download
Funq is by no means a revolutionary concept to DI, I’m well aware of that. But it’s one that takes a minimalistic approach to keep the performance impact of DI to a bare minimum. One of the project core requirements was to perform very well on the Compact Framework, as part of its inclusion in the upcoming Mobile Client Software Factory v2 from patterns & practices.
I hope this series serves to understand the inner workings of this fully functional yet extremely simple DI container.
[Update 3/10/2011]: I’ve been told these videos are being used also to showcase how to do TDD in a real-world scenario, which is quite gratifying. And I’ve just checked Amazon Cloud Front (which I use to make the downloads available to you at the fastest possible speeds without breaking the bank) and it’s still consistently delivering ~4GB/month of downloads across the globe (top EU, then USA).
[Update 3/25/2015]: Moved all videos to YouTube since now they can be high-res unlike back then . Created a playlist, but kept the original download locations.
Here is the whole series as a YouTube playlist: