Possible Duplicate:
What does the single responsibility principle mean for validation
Case A: Validate object -> Send to Method -> Method assumes valid object -> Method executes
Case B: Send to Method -> Method checks object validity -> Method executes ONLY IF valid
In case A, I can have the method be responsible for 1 task (execute). However, I may accidentally pass an invalid object. (Of course I can prevent this with careful coding, but this is the heart of my question...)
In case B, the method will never execute on an invalid object, but it must be responsible for not only executing its code but also object validation. Isn't this sort of violating "single responsibility" ?
THANK YOU!