SOLID Principle

SOLID principles complement each other, and work together in union. Single Responsibility Principle Every software component should have one and only one responsibility / reason to change Group the responsibilities in a sensible way Cohesion - 内聚 The degree to which the various parts of a software component are related Example of garbage classification Aim for high cohesion Coupling - 耦合 The level of inter dependency between various software components Aim for loose coupling Changes are inevitable, so we need higher cohesion and loose coupling...

Jun 29 2022 · 2 min · Jiayuan Zhang