Single Responsibility Principle

From NovaOrdis Knowledge Base
Revision as of 22:22, 3 January 2022 by Ovidiu (talk | contribs) (→‎Internal)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

External

Internal

Overview

Robert C. Martin: Gather together those things that change for the same reason, and separate those things that change for different reasons.

Other formulation is: a class should have only a single reason to change.

The single responsibility principle is another way to define cohesion.