Sharing Our Passion for Technology
& continuous learning
〈  Back to Blog

Pragmatic Application of Principles

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, 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.

References: Kerievsky, J. (2004). Refactoring to Patterns. Boston: Addison-Wesley.

Summary: This book provides a clear rational for when we should work towards a pattern.  Josh focuses the application of patterns on smells that exist in a system.  He provides clear refactoring paths towards and even away from patterns.  Reading this book radically changed my view of patterns and helped me appreciate them as a vital tool.

Martin, Robert C., Agile Principles, Patterns, and Practices in C#, Prentice Hall, p. 118.

Summary: Like the title suggests this book provides a great introduction to Agile software development.  While this is an excellent introduction, it does not compel me to reread this book.  The second section covers Agile design.  This section connects the Agile principle of responding to change with tested design principles.  These principles are fundamental concepts that have been around for decades.  I find this chapter to be a valuable anchor within our rapidly changing industry.

〈  Back to Blog