JetBrains Rider
 
Get JetBrains Rider
Get your hands on the new features ahead of the release by joining the Early Access Program for Rider 2025.1! Learn more

Extract Interface refactoring

Last modified: 23 September 2024

This refactoring helps create a new interface based on a selected type. JetBrains Rider suggests choosing members to be transferred to the new interface. After extraction, the original type is updated to implement the new interface.

If the current type already implements any interfaces, those interfaces can also be extracted into the new interface.

In the example below, the Color property and the Draw method of the Circle class are extracted to create a new interface:

JetBrains Rider. Extracting interface from a class