Renaming an interface operation

Renaming an interface operation can break your application if you do not also update all the dependencies that use the former operation name. Refactoring makes those updates for you automatically after you preview and accept the changes.

Although you can edit the operations of an interface directly in the editor, in most cases you should use refactoring. If you rename an operation by editing the object in the editor, the operation will have a new name, but no relationships that use the former name will change.

To change the name of an operation and all the dependencies that use the name:

  1. In the editor, right-click the operation that you want to change.
  2. In the pop-up menu, select Refactor > Rename Operation.
    This screen capture shows the Refactor menu for renaming an operation.
  3. In the Rename wizard, type the new name. As soon as you change the name, the Preview button becomes available.
  4. Leave the check box selected. To see the refactoring actions that will be performed to complete the renaming and update the dependencies across the application, click Preview. Click the plus signs to see details. If you try to refactor while you have unsaved changes in the editor, you will be prompted to save the changes in the editor. Save the changes if you are sure you want to do so, or click Cancel to reconsider the changes before saving the editor and refactoring.
  5. Accept all the refactoring actions. Click OK to initiate the refactoring operation or Cancel to close the wizard without making the change. Be aware that you cannot undo a refactoring operation once it is performed except by refactoring again. The status bar shows that the workspace is being updated. It clears when the refactoring operation finishes.

Feedback
(C) Copyright IBM Corporation 2005, 2006. All Rights Reserved.