Cohesion measures whether a component’s responsibilities and internals belong together. High cohesion keeps a component focused; low cohesion blurs its responsibility and makes complexity harder to manage. section 1.3 section 1.3.1
A component becomes cohesive when it concentrates on one responsibility instead of reading devices, correcting data, and communicating with remote systems at once. Interfaces help separate those concerns and distribute responsibility more clearly. section 1.3.1
Temperature observation
A low-cohesion Observer reads a native thermometer, converts Kelvin values, applies a hard-coded correction, and sends the result to a server. A better design gives the Observer an ISensor and an IConnection: it reads sensor data and sends it, while concrete implementations handle device details and external connections. The same principle applies to functional code; Haskell functions can also combine unrelated effects and become highly coupled.



