How To Refactor for Dependency Injection, Part 2: Composition Root June 18, 2014 Ondrej Balas continues his discussion on refactoring your code for dependency injection, this time focusing on the composition root pattern.