Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Module behavior should serve a singular purpose.
Cohesion is a measure of how closely related and focused the various responsibilities of a module are. In the worst-case scenario, little emphasis is placed on the allocation of classes to modules. Instead, behavior is allocated randomly, and the likelihood that modules suffer from lack of cohesion is high. In the best-case scenario, modules exhibit high degrees of functional cohesion, and the entities composing the module each work in conjunction to fulfill module behavior.
In general, cohesion is a qualitative measurement that is difficult to measure objectively. Instead, we typically refer to a software module as possessing either high cohesion or low cohesion. Modules with higher degrees of cohesion are preferred.