Dependency Injection
← Back to Modern and Functional Patterns
Provide dependencies externally, inversion of control. Instead of a class creating its own dependencies, they are passed in from outside (constructor, setter, or interface injection). Enables testability, flexibility, and adherence to the Dependency Inversion Principle.
Key Properties
Related
- Dependency Inversion Principle (the principle DI implements)
- Singleton (DI replaces singletons)