One reason to change is not one tiny class
Use Single Responsibility Principle to split code by independent reasons to change.
The move: split when change reasons diverge. SRP helps you avoid classes where unrelated policies collide. The problem is not that a class has ten methods. The problem is that five departments can change those methods for five unrelated reasons. Ask who owns the change A password rule changes because security policy changes. A CSV shape changes because reporting changes. An email template changes because lifecycle messaging changes. If those all live in one class, each release has needless merge and regression risk. Keep cohesive behavior together Do not split blindly. A Subscription can reasonably calculate renewal date, cancellation eligibility,…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in