- In software design, coupling degree and cohesion degree are commonly used as standards to measure the degree of module independence.
- Module cohesion and coupling are two opposite and closely related concepts.
- One of the rules for dividing modules is“High cohesion, low coupling” 。
cohesion
- Also known as intra-block linkage
- Refers to theThe functional strength of a module is a measure of how closely the elements within a module are integrated with each other.
features
- Cohesion is a measure of how closely the components of a module are connected to each other.
- The more closely the components of a module are combined, the higher the cohesion of the module and the higher its independence.
- The ideal cohesiveness requires modules to be clear and single in function, that is, a module does only one thing.
coupling
- Also known as coupling degree, is a measure of the degree of association between modules.
- The strength of the coupling depends on the complexity of the module interface, how the module is called, and how much data is sent through the interface.
features
- The degree of coupling between modules refers to the dependency between modules, including control relation, call relation and data transfer relation.
- The more connected the modules are, the stronger their coupling is and the worse their independence is.