RAD Studio (Common)
ContentsIndex
PreviousUpNext
Refactoring: Extracting Interfaces

The following conditions should be met for extracting interfaces:

  • Only non-static methods can be extracted.
  • All methods in the extracted interface are public.
  • If the name specified for the new interface coincides with the name of an existing interface in the same namespace, all the methods will be extracted into an existing interface.

To extract an interface:

  1. Select one or more code elements (class, interface, field, method, event, property, or indexer) in the Diagram View or Model View.
  2. On the main menu, choose RefactoringExtract Interface
    Tip: Alternatively, you can choose Refactoring->Extract Interface
    on the context menu of the selection.
  3. In the Extract interface dialog box, enter the name for the interface and designate its namespace, if applicable.
  4. Specify the members to be used in the resulting interface by setting or clearing the respective check-boxes.
  5. Click OK. The Refactoring window opens allowing you to review the refactoring before committing to it.
  6. Click the Perform refactoring button to complete the extraction.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!