dependency-injection-module-patterns
Installation
SKILL.md
Dependency Injection and Module Patterns
Overview
Dependency Injection (DI) supplies an object's dependencies from outside rather than letting it create them. Combined with the Dependency Inversion Principle (DIP), it is the primary technique for loose coupling. Module/package organisation either enables or defeats DI by controlling dependency direction.
Cross-reference: DIP — review-solid-clean-code; Factory patterns in Composition Root — design-patterns-creational-structural
When to Use
- Business logic creates its own collaborators (
new ConcreteClass()inside services) - Hidden dependencies make unit testing impossible without real infrastructure
- Evaluating framework wiring (Spring, tsyringe, FastAPI, Wire) for correctness and scope
- Reviewing module boundaries for circular imports or over-coupled packages