DEV Community

Discussion on: Single-Responsibility Principle done right

Collapse
 
courier10pt profile image
Bob van Hoove

I've always felt that SRP is the most confusing of SOLID principles and perhaps the hardest to get right.

If you (mis)take 'Single Responsibility' to the extreme in a language like Java or C# you end up with many classes exposing a single function. This should make you wonder, am I using the right language? All these functions in mini objects could be partially applied functions in another language.

In my interpretation I decided to focus on the 1 reason to change aspect, the single aspect never really made sense to me. As you point out, the unit of responsibility should center around cohesion. And now it does make sense.

Thanks for writing.

Collapse
 
riccardo_cardin profile image
Riccardo Cardin

Thanks to you to have summarized the entire post so well.