@@ -646,11 +646,10 @@ Resources
646646
647647## Dependency Inversion Principle
648648
649- Dependency Injection is an Inversion of Control technique for supplying objects (“dependencies”) to a class by a way of
650- the Dependency Injection Design Pattern. Typically passing dependencies via constructor or field. In contrast the
651- Dependency Inversion Principle is a general design guideline which recommends that classes should only have direct
652- relationships with high-level abstractions. This means that classes should not depend on low-level details, emphasizing
653- the use of interfaces and abstract classes.
649+ Dependency Inversion is the strategy of depending upon interfaces or abstract functions and classes rather than upon
650+ concrete functions and classes.
651+ Simply put, when components of our system have dependencies, we don’t want directly inject a component’s dependency into
652+ another. Instead, we should use a level of abstraction between them.
654653
655654Why
656655
659658- Facilitates unit testing by allowing the use of mock objects, enabling isolated testing of modules.
660659- Reduces the risk of breaking the system when changes are made.
661660- Allows to add new implementations without changing the existing code, enhancing the system's extensibility.
661+ - Concrete classes change frequently, while abstractions and interfaces change much less.
662662
663663How
664664
670670Resources
671671
672672- [ SOLID — Dependency Inversion Principle] ( https://medium.com/@inzuael/solid-dependency-inversion-principle-part-5-f5bec43ab22e )
673- - [ Dependency Injection (wikipedia.org)] ( https://en.wikipedia.org/wiki/Dependency_injection )
674-
673+ - [ DDependency inversion principle (wikipedia.org)] ( https://en.wikipedia.org/wiki/Dependency_inversion_principle )
674+ - [ System Design: Dependency Inversion Principle ] ( https://www.baeldung.com/cs/dip )
675675## SOLID
676676
677677A subset of programming principles:
0 commit comments