Cohesion and Coupling matter

From Programmer 97-things

Jump to: navigation, search

Cohesion and Coupling appear to many to be academic terms used to describe some form of "quality" of software. In the real world these concepts really do have an impact on the understandability and maintainability of software. It is easy to spot the difference between code with maintained Cohesion and Coupling and code without.

In Classical Object Orientated software:

Cohesion is the concept of how closely a class corresponds to a single concept in the problem (or solution) space. A class which represents a single well defined concept is considered Cohesive, one that represents many concepts (or none) is not considered Cohesive.

Coupling is the concept of how many classes a class depends on, the higher the number of dependencies the more coupled a class is, where more Coupling is a bad thing.

Personal tools