DependencyInjection
Dependency Injection is a software design pattern and a form of inversion of control in which an object receives its dependencies from external sources rather than creating them itself. By decoupling the creation of dependencies from their use, DI promotes modular architecture, easier testing, and greater flexibility in swapping implementations.
DI typically relies on a container, framework, or assembler that manages object lifetimes, resolves dependencies, and
Lifetimes or scopes managed by a DI container include singletons, scoped instances, and transients. The container
DI aligns with the dependency inversion principle: high-level modules should not depend on low-level modules; both