Difference between Single Responsibility Principle and Separation of Concerns

Rookian picture Rookian · Nov 12, 2009 · Viewed 18.3k times · Source

What is the difference between Single Responsibility Principle and Separation of Concerns?

Answer

luvieere picture luvieere · Nov 12, 2009

Single Responsibility Principle (SRP)- give each class just one reason to change; and “Reason to change” == “responsibility”. In example: Invoice class does not have a responsibility to print itself.

Separation of Concerns (since 1974). Concern == feature of system. Taking care of each of the concerns: for each one concern, other concerns are irrelevant. Hiding implementation of behavior.

From here.