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 Superclass refactoring

Last modified: 23 September 2024

This refactoring allows you to extract certain members from a selected class into a new base class. The original class will extend the created base class.

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

If you want to create an abstract class, mark at least one of the extracted method abstract.

In the example below, we extract an abstract class Shape from the existing class Circle:

JetBrains Rider. Extract Superclass (Base class) refactoring