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 http://www.refactoring.com/).

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.

Featured

  • Azure Backup for SQL Server Now Commercially Available

    Microsoft on Monday announced that Azure Backup for SQL Server had reached "general availability" status, meaning it's deemed ready for production-environment use.

  • Insights for MyAnalytics Getting Switched On for Office 365 Users This Month

    Microsoft is planning to activate "Insights for MyAnalytics" sometime late this month for most Office 365 users, but the ability of organizations to manage this feature won't be available until possibly mid-May.

  • SharePoint Framework 1.8 Now Generally Available

    Microsoft this week announced that SharePoint Framework 1.8 had reached "general availability" status, although some features are still at the preview stage.

  • How To Create Office 365 User Accounts in Bulk

    Manual account creation can be tedious, time-consuming and prone to human error, especially if you have more than a handful of Office 365 users to set up. Brien shows you a better way.

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.