The following refactoring operations are available:
Refactoring operations
Operation |
Description |
Change parameters |
You can rename, add, or remove parameters for a single method using the Model View, Diagram View, or the Editor. |
Extract interface |
The Extract Interface command creates a new interface from one or more selected classes. Each selected class should implement the interface. |
Extract method |
You can extract method from a class or interface using the Editor only. It is important that the code fragment to be extracted must contain complete statements. |
Extract superclass |
The Extract Superclass command creates an ancestor class from several members of a given class. |
Inline variable |
If you have a temporary variable that is assigned once with a simple expression, you can replace all references to that variable with the expression using the Inline Variable command in the RAD Studio Editor. |
Introduce field |
Creates a new field. |
Introduce variable |
Creates a new variable. This command is available in the Editor. |
Move members |
Moving members only applies to the static methods, static fields and static properties (static members). This command is available on the Diagram View, on the Model View, and in the Editor. |
Pull Members Up |
Use this command to copy a member (field, method, property, indexer, and event) from a subclass to a superclass, optionally making it abstract. If there are no superclasses, an error message is displayed. |
Push Members Down |
Use this command to copy a member (field, method, property, and event) from a superclass to a subclass, optionally making it abstract. If there are no subclasses, an error message is displayed. Indexers cannot be pushed down. |
Rename |
You can rename certain code elements: class, interface, method, field, parameter, local variable, and so on. The modeling feature propagates the name changes to the dependent code in your project files. You cannot rename indexers, constructors, or destructors. You can rename namespaces by changing their names in the Diagram or Model Views. The modeling feature makes the appropriate changes in this case as well. This action does not require you to use the Refactoring commands. When renaming a method, all descendant classes are scanned for possible overrides. All found overrides and their usages are renamed too. However, if the method being renamed overrides some base class method, you are asked if you want to rename this base class method (and all overrides as well), or only the selected method (and its overrides). Refactoring also checks whether the method name that you enter coincides with some base class method. In such cases, a warning is displayed. When renaming a method that belongs to a child class, you can choose to propagate renaming to the parent classes and overloads, checking the respective options Refactor Ancestors and Rename Overloads in the Rename Method dialog. If such renaming in the ancestor classes is impossible, a warning message appears. However, you can still rename the selected method only. If you rename a model element that is referenced from another project, RAD Studio updates both projects. |
Safe Delete |
The Safe Delete command searches your code for any usages of the element that you wish to delete. You can invoke the command from the Diagram View, Model View, or from the Editor. |
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|