The “dependency injection” (DI) technique is a way to improve testability and maintainability of object-oriented code. Typically adoption of dependency injection is coupled with adoption of a dependency injection framework, such as Guice or Spring. These materials show how dependency injection can be accomplished without any framework. The same benefits provided by frameworks can be realized using “do-it-yourself” (DIY) handcrafted code. This model is named DIY-DI, pronounced die-die.
- State of the Art Testability (online slide deck, also available in PowerPoint)
- DIY-DI (accompanying how-to manual)
- DIPresentation (accompanying code examples)
Update (May 29, 2010): I added a comparison with Guice and more polished code snippets to the DIY-DI manual.