Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Complex Refactoring in Simple Steps: Part II [Video]

DZone's Guide to

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.

· DevOps Zone
Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

Matthew 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.

Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

Topics:
complex refactoring ,resharper ,devops ,polymorphism

Published at DZone with permission of Matthew Butt, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}