While I understand your case (and I, for sure, have also written such code) I have two main concerns about your example:
You say „a huge class that performs many tasks“. I‘ll just refer to „Single Responsibility Principle“ here: 1 Class -> 1 Purpose/Task
How would you ever write a Unit test for your RefactoredBigClass? There is no way you could ever test your handle() function there.
Thank you for your concern, Christian. At your first point: I don't know what you mean by that 🤔 And to your second point: I'm not unit testing this class 😁
For the first point, see: scotch.io/bar-talk/s-o-l-i-d-the-f... For the second point: Well, that's your fault ;)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
While I understand your case (and I, for sure, have also written such code) I have two main concerns about your example:
You say „a huge class that performs many tasks“. I‘ll just refer to „Single Responsibility Principle“ here: 1 Class -> 1 Purpose/Task
How would you ever write a Unit test for your RefactoredBigClass? There is no way you could ever test your handle() function there.
Thank you for your concern, Christian.
At your first point: I don't know what you mean by that 🤔
And to your second point: I'm not unit testing this class 😁
For the first point, see: scotch.io/bar-talk/s-o-l-i-d-the-f...
For the second point: Well, that's your fault ;)