mirror of
https://github.com/NohamR/knowledge-kit.git
synced 2026-05-25 04:17:17 +00:00
552 B
552 B
SOLID之依赖反转原则
依赖反转原则的英文翻译是 Dependency Inversion Principle,缩写为 DIP。中文翻译有时候也叫依赖倒置原则。
High-level modules shouldn’t depend on low-level modules. Both modules should depend on abstractions. In addition, abstractions shouldn’t depend on details. Details depend on abstractions.
高层模块不应该依赖低层模块,高层模块和低层模块都应通过抽象来互相依赖。抽象不要依赖具体的实现细节,具体的实现细节应该依赖抽象。