Single Responsibility Principle
A responsibility means a coherent ownership and its reasons for change, not one individual method.
- ResponsibilityGroups behavior that changes for the same reason.
- Reason for changeExplains why a change becomes necessary for business or organizational reasons.
- CouplingChanges that happen together reveal where responsibilities are coupled.
Context
Why this is important
Group and separate responsibilities based on concrete reasons for change.
A design principle for business and technical module boundaries.
Responsibility and reason for change
The example shop remains a modular monolith with seven modules and a shared deployment.
This is how you read the picture
- Responsibility Responsibility
- Reason for change Trigger
- Coupling Change pattern
| Change | Observation | Possible responsibility |
|---|---|---|
| Business rule | Rule changes | Business module |
| Presentation | Format changes | Document component |
Benefits & limitations
Helps if:
- A component must change for unrelated reasons.
- Changes can be assigned to a coherent business or organisational responsibility.
Boundaries
- “One class per method” increases the number of components and scatters related knowledge.
- A clear reason for change is contextual; teams must test boundaries against real change patterns.
In practice
- Collect concrete changes from recent months and map them to the affected modules and classes. Check with the change team whether the cases share the same business or organizational reason.
- Group behavior that changes for the same reason and separate responsibilities with independent causes for change. Describe each responsibility as a coherent decision, not as a single method.
- Compare the proposed boundary with a concrete change case. If one requirement regularly makes several groups change together, check whether the model has divided rules or responsibilities poorly.
Read the detailed explanation
The Single Responsibility Principle is often explained as “one reason to change.” It helps align responsibilities with business or organisational reasons for change. A class may contain several methods when they serve one coherent task. Conversely, a single method can mix concerns when it handles business calculation, database access and formatting.
The principle examines reasons for change; Separation of Concerns frames concern separation, while Cohesion assesses how well a component holds together.
Check your understanding
Test yourself in three stages
ReadingCheck in the picture
Which responsibility fits a change to shipping rules?
View the solution with justification
Business ownership of shipping.
ApplyingTransferred to a new situation
How do you check whether two tasks belong together?
View the solution with justification
Compare whether they arise from the same business reasons for change.
EvaluateWeighing an alternative
What is the effect of spreading one responsibility across many modules?
View the solution with justification
A business change requires coordinated updates in several places.
Explore further
These building blocks continue the thoughts of this page.
References
- Robert C. Martin · The Single Responsibility Principle (opens in new tab)Explanation of reason for change as the guiding criterion.
- Martin Fowler · Shotgun Surgery (opens in new tab)Code smell for changes that affect many locations.
- Pearson · Agile Software Development: Principles, Patterns, and Practices (opens in new tab)Book source on SOLID principles and design.