Product Reviews

C# Refactory

Here's a way to recode objects in many ways without losing your place.

Refactoring is the process of rearranging code in a disciplined way. The goal of refactoring is to go from messy code to clean code, with all of the advantages in understandability that that implies (for more information, see Martin Fowler's excellent book on the subject or his Web site

Of course, where there's a technique there's a tool. C# Refactory is a tool designed to help you refactor C# code in the .NET interface by simply selecting menu choices and filling in simple dialogs. In its first incarnation, C# Refactory supports these refactorings:

  • Extract Method
  • Extract Superclass
  • Extract Interface
  • Copy Class
  • Rename Parameter
  • Raname Local Variable
  • Rename Member
  • Rename Type

Take "Extract Interface," for example. After a development session you might realize that you've got some functionality that needs to be generalized and then reimplemented in several different ways. With the Extract Interface refactoring, you just supply a name for the new interface and specify which methods of the existing class should come from the interface. C# Refactory builds the interface definition and modifies the class to implement the interface, without any manual intervention.

In addition, C# Refactory supplies a set of metrics (lines of code, cyclomatic complexity, lines of comments, and so on) that can be calculated on any level from solution on down. If your development process is at all driven by this sort of number, you'll find this useful.

I was impressed at how easy to use this product was after installation. Though the initial catalog of refactorings is fairly small, they seem to have thought hard about what would be useful. And they're improving fast; indeed, while I was editing this review, a new version with one more refactoring was available for download to my computer. If you're working on a large object-oriented C# project, you'll find a home for this in your tool kit.

About the Author

Mike Gunderloy, MCSE, MCSD, MCDBA, is a former MCP columnist and the author of numerous development books.


  • Windows 10 Preview Adds Windows Subsystem for Linux 2 on ARM64 Devices

    Microsoft's latest Windows 10 preview release for testers (build 18980), announced on Wednesday, includes support for version 2 of the Windows Subsystem for Linux, plus ARM64 device support for WSL 2.

  • Microsoft Defender Advanced Threat Protection Evaluation Lab Now Available

    The Microsoft Defender Advanced Threat Protection (ATP) Evaluation Lab is now ready for use by organizations.

  • How Organizations Can Adapt to SharePoint's 'Modern' Shift

    In a September interview, SharePoint expert Asif Rehmani described how users, developers and organizations are dealing with SharePoint Online's so-called "modern" innovations.

  • Microsoft Urges LDAP Workaround Fix for Windows Systems

    Microsoft updated an August security advisory this week to urge organizations using the Lightweight Directory Access Protocol in supported Windows systems to implement some configuration changes manually.

comments powered by Disqus

Office 365 Watch

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.