什么是“高级模块”?和“低级模块” (在依赖倒置原则的背景下)?
我正在阅读维基百科对依赖倒置原则的定义,它使用了两个术语高级模块和低级模块,我无法弄清楚。
它们是什么以及依赖倒置原则与它们有什么关系?
I was reading Wikipedia's definition of Dependency inversion principle, and it uses two terms High-level modules and low-level modules, which I wasn't able to figure out.
What are they and what does Dependency inversion principle have to do with them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些的定义在介绍性句子中给出:
高层:政策制定
低级:依赖模块。
通俗地说:高层模块依赖于低层模块,但不应该依赖于它们的实现。这可以通过使用接口来实现,从而将服务的定义与实现解耦。
The definition of those are given in the introductory sentence:
high level: policy setting
low level: dependency modules.
In laymen's terms: high level modules depend on low level modules, but shouldn't depend on their implementation. This can be achieved by using interfaces, thus decoupling the definition of the service from the implementation.
这里解释一下:
https://softwareengineering.stackexchange.com/a/419630
This is explained here:
https://softwareengineering.stackexchange.com/a/419630