Hacker News new | ask | show | jobs
by whstl 1057 days ago
Calling it a misconception is not really fair.

The "serve a single actor" is a recent revision of the principle by Uncle Bob, from a 2018 book, AFAIK. That's almost 20 years too late (if going by the sources I can find).

I can't find mentions of "actors" or similar terms in Agile Software Development or Clean Code. Pretty much every pre-2018 literature says that SRP relates to modules "[having a] single reason to change", or "[not having] too many responsibilities". The examples are always fuzzy and imprecise, but in the books the principle essentially boils down to class/method size. There are no examples in Clean Code or ASD relating to this new meaning, nor mentions of "actors" or "stakeholders", and until recently there's rarely any article contradicting the original meaning of SRP.

This revisionism seems to come first from backlash from part of the programming community, and also an adaptation of the more recent "one team per microservice" rule.

But the damage of almost 20 years of SRP being taught the way it was in the past was already done.

1 comments

From Wikipedia, Uncle Bob made a book in 2017 and one in 2019.

Do you know which one you're referring to?

2017. Clean Architecture: A Craftsman's Guide to Software Structure and Design. Prentice Hall. ISBN 978-0134494166.

2019. Clean Agile: Back to Basics. Prentice Hall. ISBN 978-0135781869.

It's the 2017 one, thanks for the correction.