# 
Dimit's Law

By [rojeck](https://paragraph.com/@rojeckluo) · 2021-11-29

---

    The Law of Demeter (LOD), sometimes called the Least Knowledge Principle (LKP), is defined as: a software entity should interact with other entities as little as possible. Each software unit has minimal knowledge of other units, and is limited to those software units that are closely related to the unit. The original intention of Dimit's Law is to reduce the coupling between classes. Since each class minimizes its dependence on other classes, it is easy to make the functional modules of the system function independent, and there is no (or very little) dependency relationship between each other. Dimit's Law does not want to establish a direct connection between classes. If there is a real need to establish a connection, I hope it can be conveyed through its friend class (intermediate class or jump class).

---

*Originally published on [rojeck](https://paragraph.com/@rojeckluo/dimit-s-law)*
