Over a million developers have joined DZone.

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

The DevOps Zone is brought to you in partnership with Sonatype Nexus. The Nexus Suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

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.

The DevOps Zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today

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.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}