How do you determine how coarse or fine-grained a 'responsibility' should be when using the single r

Posted by Mark Rogers on Stack Overflow See other posts from Stack Overflow or by Mark Rogers
Published on 2010-03-16T15:31:56Z Indexed on 2010/03/16 16:51 UTC
Read the original article Hit count: 202

Filed under:
|
|
|
|

In the SRP, a 'responsibility' is usually described as 'a reason to change', so that each class (or object?) should have only one reason someone should have to go in there and change it.

But if you take this to the extreme fine-grain you could say that an object adding two numbers together is a responsibility and a possible reason to change. Therefore the object should contain no other logic, because it would produce another reason for change.

I'm curious if there is anyone out there that has any strategies for 'scoping', the single-responsibility principle that's slightly less objective?

© Stack Overflow or respective owner

Related posts about srp

Related posts about design