Single Responsibility Principle: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 6: Line 6:


* [[SOLID Principles#SOLID_Principles|SOLID Principles]]
* [[SOLID Principles#SOLID_Principles|SOLID Principles]]
* [[Cohesion]]
* [Designing Modular Systems#Cohesion|Designing Modular Systems]]


=Overview=
=Overview=
Line 14: Line 14:
Other formulation is: a class should have only a single reason to change.
Other formulation is: a class should have only a single reason to change.


The single responsibility principle is another way to define [[Cohesion|cohesion]].
The single responsibility principle is another way to define [[Designing_Modular_Systems#Cohesion|cohesion]].

Revision as of 21:42, 3 January 2022

External

Internal

  • SOLID Principles
  • [Designing Modular Systems#Cohesion|Designing Modular Systems]]

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.