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

I read the Wikipedia definition of the dependency inversion principle , and it uses two terms High- level modules and low-level modules , which I could not figure out.

What are they and what does the dependency inversion principle do?

+4
source share
2 answers

Their definition is given in the introductory sentence:

high level: policy setting
low level modules: dependent.

In lay conditions: high-level modules depend on low-level modules, but should not depend on their implementation. This can be achieved using interfaces, thereby separating the definition of service from implementation.

+5
source
  • A low-level module is a program written to solve a specific problem (calculating watts based on a country code).
  • A high-level module is a program written to solve a common problem (access to a database).
+2
source

All Articles