Dependency Injection and Inversion of Control ( IoC ) tools are becoming all the rage. If you don't believe me, check out me on .NET Rocks! talking about Unity, which is Microsoft Patterns & Practices Dependency Injection Tool that you can download separately or as a part of Enterprise Library.
I had the pleasure of building my own Dependency Injection Application Block which was far from feature-rich compared to Autofac, Ninject, StructureMap, Unity, etc., but it was interesting to tackle the project for fun.
Interesting enough, Daniel Cazzulino, author of Moq, has put together a series of screencasts showing one how to build a dependency injection container using Test-Driven Development ( TDD ). I haven't personally watched the screencasts, but the descriptions sound really promising:
- Part I: selecting a high performance approach and building the basics with few lines of code.
- Part II: adding support for passing constructor arguments to resolved instances.
- Part III: adding named services and refactoring to improve code.
- Part IV: add support for instance reuse.
- Part V: adding support for container hierarchies.
- Part VI: adding deterministic disposal of container hierarchies and instances created by them.
- Part VII: polishing a fluent API.
- Part VIII: adding support for initializer functions.
- Part IX: how well does it perform really?
When I get back from the South Florida Code Camp I will be checking these out.
Learn more here.
Related Posts: