educative.io

Isn't SRP about modules responsibility?

“Single responsibility principle simply means giving only one responsibility to a component and letting it execute it perfectly, be it saving data, running the application logic or ensuring the delivery of the messages throughout the system.”

I think there is a misusage in the term SPR, the Single Responsibility Principle is about how do we arrange our functions and classes in a given module, rather than how we arrange our system components.

The appearance of the SRP concept at the system components level becomes the Common-Closure Principle. At the architectural level, it becomes the Axis of Change responsible for the creation of Architectural Boundaries.

SRP in my opinion is more of a general rule as opposed to being specific to code or system components regardless of what the standard definitions say. It’s what the developers use all the time when designing apps and writing code. Common-Closure and Axis of Change might be standard definitions but they are rarely used in contrast to SRP in our day to day development work.