Replace Method with Method Object... I find it weird to see that a new class is considered a drawback

Richard Lalancette 8 years ago updated by Marina Pavlova 8 years ago 1

In find, this is complying to SRP of the solid principles. I would remove this drawback.

Alternatively, that class could be made into a nested class instead.


  • Another class is added, increasing the overall complexity of the program.

Hello Richard,

Thanks for your suggestion. Yes, you can avoid this drawback when using refactoring only in reasonable cases. That drawback is intended to warn about unreasonable usage.

By the way, some programming languages don't have inner classes support (for example, PHP).