Cohesion and Coupling

2022-05-13  本文已影响0人  reikoclh

Cohesion measures level of close connection of inner elements in module. The cohesion can be divided into seven types.

(1) function

All elements are needed to implement the same function, each element is indispensable.

(2) order

It is similar to the function cohesion, and all elements must be executed in order.

(3) communication

All elements belong the same data structure.

(4) process

It is similar to the order cohesion. The difference is that the order cohesion emphasizes data flow, however the process cohesion emphasizes control flow.

(5) microtime

All tasks must be executed in the same time quantum.

(6) logic

(7) occasional

All tasks have no connection with each other. It is the worst cohesion.

上一篇 下一篇

猜你喜欢

热点阅读