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.


  • Microsoft Shifting Away from Office 365 Brand Name in April

    Microsoft on Monday announced coming product naming changes, where "Office 365" is mostly getting replaced by the "Microsoft 365" brand.

  • Microsoft Grows Services Amid COVID-19

    Microsoft in a Saturday announcement recapped how its services have been affected by "shelter-in-place" governmental mandates in the last week, providing details on growth stats and prioritizations.

  • Microsoft Adds 6 More Months to Expiring Certification Programs

    Microsoft has announced an extension to the end date of three certification programs slated for retirement.

  • Microsoft's Surface Pro X: It's Like the Surface RT, But Better

    There's a lot about the Surface Pro X that's reminiscent of the ill-fated Surface RT. But despite the similarities, this might just be one of the rare cases where the sequel is better than the original.

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.