September 14, 2007 - Castalia 5.2 is now available. Starting at $99 in our online store.

Castalia LogoRefactoring

Rename Local Variable Screenshot

About Refactoring

Refactoring is 'improving the design of code after it has been written' (Fowler, Martin. Refactoring pp. xvi). Developers spend a lot of time maintaining code that has already been written, and often has already been tested. Castalia offers automated refactorings - based on published and accepted methodologies - for several commonly used changes to code.

Castalia's refactoring work on the scope of the entire project. When a refactoring is invoked, Castalia will run through your entire project, evaluating the relevance of the refactoring to each unit, and applying changes as necessary.

Castalia's automated refactorings:

  • Rename Local Variable
    Changes the name of a local variable and all references to the variable within a single method.
  • Rename Parameter
    Changes the name of a parameter in both the interface and implementation declarations, and all references to the parameter within the procedure or function.
  • Inline Temporary Variable
    When a variable is assigned the value of a simple statement, this refactoring removes the variable from the procedure and replaces all instances of the variable with the simple statement.
  • Introduce Explaining Variable
    Declares a new variable and initializes it to a specified expression.
  • Split Temporary Variable
    When a variable is assigned more than once, it is often wise to "split" the variable into two distinct variables. Split Temporary Variable automates this by adding a new variable to the procedure and making appropriate changes to split the original variable in two.
  • Rename Method
    Changes the name of a procedure or function and all references to the procedure or function.
  • Extract Method
    Extracts a code segment into a separate procedure, replacing the original segment with an appropriately constructed call to the new procedure.
  • Add Parameter
    Adds a new parameter to a procedure or function, synchronizing both the interface and implementation declarations of the method.
  • Rename Class
    Changes the name of a class, changing all references to the name of the class to reflect the class' new name.
  • Move Class
    Moves a class definition and all of its methods into a different unit.