Files
knowledge-kit/Chapter6 - Design Pattern/6.7.md
2023-10-31 15:17:07 +08:00

8 lines
552 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# SOLID之依赖反转原则
依赖反转原则的英文翻译是 Dependency Inversion Principle缩写为 DIP。中文翻译有时候也叫依赖倒置原则。
> High-level modules shouldnt depend on low-level modules. Both modules should depend on abstractions. In addition, abstractions shouldnt depend on details. Details depend on abstractions.
高层模块不应该依赖低层模块,高层模块和低层模块都应通过抽象来互相依赖。抽象不要依赖具体的实现细节,具体的实现细节应该依赖抽象。