Complex Refactoring in Simple Steps: Part II [Video]
Matthew Butt demonstrates how to compose simple automated refactoring steps in ReSharper to refactor code to better designs.
Join the DZone community and get the full member experience.
Join For FreeMatthew Butt demonstrates how to compose simple automated refactoring steps in ReSharper to refactor code to better designs.
In this episode, we spot a conditional with three branches. We decompose this conditional to clarify the logic, then extract method objects to encapsulate the behaviour of each branch. By the time we've finished, we are well on our way to implementing polymorphism.
The code used in this video can be found on GitHub.
This article was first published on the Codurance blog.
Published at DZone with permission of Matthew Butt, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments