User Tools

Site Tools


This is an old revision of the document!

High Cohesion (HC)

Variants and Alternative Names


Principle Statement

Cohesion in a module should be high.


The cohesion of a module is a measure for how well the internal parts of a module (e.g. the methods and attributes of a class) belong together. Having a high cohesion means, that a module should only comprise responsibilities which belong together.

Several kinds of cohesion can be distinguished some of which are strong and some of which are loose. So strong forms of coupling should be preferred.


Not adhering to this principle, i.e. having a low cohesion, means that one module has several unrelated or only loosely related responsibilities. A change in the requirements for one of these may thus also affect the others which would not be the case in a highly cohesive module.


See section contrary principles.


W. P. Stevens, G. van Niekerk, G. J. Myers, L. L. Constantine: Structured design


  • Examined: There are metrics that try to measure cohesion and there are studies relating these cohesion measures to the number of errors found during testing 1). This correlation is evident. The limitation of these studies is that these cohesion metrics cannot represent the cohesion notion completely.
  • Accepted The concept of high cohesion is widely known and described in several well-known books for example in


Relations to Other Principles



Contrary Principles

  • More Is More Complex (MIMC): Making a module highly cohesive often results in additional modules. Sometimes it is simpler to assign a minor unrelated responsibility to a module, which lowers the cohesion.
  • Model Principle (MP): Adhering to HC sometimes means to split up a class into several smaller ones which might correspond to the model less well.
  • Low Coupling (LC): A system consisting of one single module has a very low coupling as there are no dependencies on other modules. But such a system also has low cohesion. The other extreme, very many highly cohesive modules, naturally has a higher coupling between the modules. So here a compromise has to be found.

Complementary Principles

Principle Collections

OOD Principle Language
General Principles Modularization Principles
Principles Information Expert High Cohesion Low Coupling
Non-Principles Controller Creator Indirection Polymorphism Protected Variation Pure Fabrication


Description Status

Class level cohesion

Robert Cecil Martin (Uncle Bob) describes maximal cohesion at class level as “a class in which each variable is used by each method”.

“In general the more variables a method manipulates the more cohesive that method is to its class.” (Clean Code: A Handbook of Agile Software Craftsmanship - Chapter 10)

Further Reading


Discuss this wiki article and the principle on the corresponding talk page.


Anbert Endres, Dieter Rombach: A Handbook Of Software And Systems Engineering

principles/high_cohesion.1559134053.txt.gz · Last modified: 2019-05-29 14:47 by