Go Up to Refactoring Applications Index
Refactoring refers to the capability to make structural changes to your code without changing the functionality of the code. Code can often be made more compact, more readable, and more efficient through selective refactoring operations. RAD Studio provides a set of refactoring operations that can help you re-architect your code in the most effective and efficient manner possible.
Refactoring operations are available for Delphi and C++.
All refactoring commands you can access from the Refactor menu or from the context menu in the Code Editor. Some refactoring commands are also accessible from the modeling panes Diagram View and Model View.
The Undo capability is available for all refactoring operations. Some operations can be undone using the standard Undo (CTRL+Z) menu command, while the rename refactorings provide a specific Undo feature.
Refactoring Operations Supported only in Code Editor
When editing your Delphi or C++ code in the Code Editor, you can employ:
- Renaming identifiers using Refactor > Rename (Delphi, C++).
- Declaring new variables using Refactor > Declare Variable (Delphi).
- Declaring new fields using Refactor > Declare Field (Delphi).
- Creating a method from a code fragment using Refactor > Extract Method (Delphi).
- Converting a quoted string to a resource string using Refactor > Extract Resource String (Delphi).
- Changing parameters of procedures and functions using Refactor > Change Params.
- Finding and adding units using Refactor > Find Unit (Delphi).
- Finding References using Search > Find References (Delphi, C++).
- Using Sync Edit mode (Delphi, C++).
Refactoring Operations Supported in both Code Editor and Modeling Views
In Code Editor and in Diagram View and Model View (used in UML Modeling), you can employ:
- Moving Members using Refactor > Move.
- Extracting Interfaces using Refactor > Extract Interface.
- Extracting Superclass using Refactor > Extract Superclass.
- "Pull Members Up" and "Push Members Down" using Refactor > Pull Members Up and Refactor > Push Members Down.
- "Safe Delete" using Refactor > Safe Delete.
- Creating Inline Variables using Refactor > Inline Variable.
- Introducing Fields using Refactor > Introduce Field.
- Introducing Variables using Refactor > Introduce Variable.
- Opening Refactorings Pane using View > Refactorings.
- Refactoring Overview