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.