I was reminded of a profound truth as I was re-reading Robert C. Martin’s book “Agile Software Development, Principles, Patterns, and Practices”, in C# this time.
It is not wise to apply (a) principle … if there is no symptom.
In this section Uncle Bob discusses the Single Responsibility Principle (SRP), which defines that a class should have only one reason, or axis, to change He concludes that:
If…the application is not changing in ways that cause the two responsibilities to change at different times, there is no need to separate them. Indeed, separating them would smell of needless change. …An axis of change is an axis of change only if the changes occur.
Too often we blindly apply principles without understanding what we are trying to solve. Patterns and principles should be responses to problems that we encounter rather than silver bullets that we must shoot into systems. I strongly recommend that you take time to read ‘Refactoring to Patterns’ by Joshua Kerievsky. This book not only explains this profound truth, but it also gives you a clear path for applying it in the real world.