What are “High-level modules” and “low-level modules” (in the context of Dependency inversion principle)?

我只是一个虾纸丫 提交于 2019-12-21 10:16:16

问题


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?


回答1:


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://stackoverflow.com/questions/3780388/what-are-high-level-modules-and-low-level-modules-in-the-context-of-depende

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!