Skip to content

Commit 9935652

Browse files
authored
Update README.md
1 parent 3028d66 commit 9935652

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

5 - Dependency Inversion Principle/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Dependency Inversion Principle (DIP)
22

3-
The Dependency Inversion Principle (DIP) is a design principle from the SOLID principles that suggests that high-level modules should not depend on low-level modules, but both should depend on abstractions. It also suggests that abstractions should not depend on details, but details should depend on abstractions.
3+
The Dependency Inversion Principle (DIP) establishes that high-level modules must not depend on low-level modules, but both should depend on abstractions. It also suggests that abstractions must not depend on details, but details must depend on abstractions.
44

5-
The DIP is important because it promotes modularity, flexibility, and extensibility, which leads to code that is easier to understand, modify, and maintain. By ensuring that high-level modules depend on abstractions rather than low-level modules, you can reduce coupling between different parts of the codebase, which makes the codebase more robust, reliable, and scalable.
5+
This principle promotes modularity, flexibility, and extensibility, which leads to code that is easier to understand, modify, and maintain. By ensuring that high-level modules depend on abstractions rather than low-level modules, you can reduce coupling between different parts of the codebase. You will need to check the dependencies between different modules or classes in the system, and ensure that each module depends on abstractions rather than concrete implementations. This may involve using dependency injection or inversion of control techniques to decouple modules and reduce the overall complexity of the codebase.
66

7-
To follow the DIP, it's important to carefully consider the dependencies between different modules or classes in the system, and ensure that each module depends on abstractions rather than concrete implementations. This may involve using dependency injection or inversion of control techniques to decouple modules and reduce the overall complexity of the codebase.
8-
9-
In practice, this means that you should design your code to depend on abstractions rather than concrete implementations. This allows you to replace implementations with different ones, without having to modify the code that uses them. It also means that you can write more modular, testable code that is easier to maintain and extend over time.
7+
Decoupling modules allows you to replace implementations with different ones, without having to modify the code that uses them.
108

119
### Class diagram for this example
1210

0 commit comments

Comments
 (0)