← All experiments
Experiments / Breno Mayder

SOLID in practice.

Five principles, with before and after examples.

S / SOLID

Single responsibility

My article on this topic ↗
Before / The problem

After / The change

What if the requirement changes?

Before

After

Illustrative examples. Splitting classes alone does not guarantee SOLID.

The full series

S · Single responsibility ↗O · Open/closed ↗L · Liskov substitution ↗I · Interface segregation ↗D · Dependency inversion ↗Reflections on SOLID ↗