Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6693291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:57:57+00:00 2026-05-26T05:57:57+00:00

I want to refactor multiple classes that I think should derive from one base

  • 0

I want to refactor multiple classes that I think should derive from one base class.

How to properly accomplish this refactoring using ReSharper 6 ? I can extract superclass from one of the classes, but what next? Do I have to manually then derive from this base class and search for same members in every class I want to be derived?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:57:58+00:00Added an answer on May 26, 2026 at 5:57 am
    1. Run all of your unit tests and see that they pass
    2. Extract the base class from one of your classes. Call it BaseClass or something
    3. Run all of your unit tests …
    4. Extract the base class from another of your classes. Call it BaseClass2 or something
    5. Run all of your unit tests…
    6. Compare BaseClass and BaseClass2 line for line. If they’re not identical, then refactor them to make them identical.
    7. Frequently running all of your unit tests…
    8. Once they’re identical, change all references to BaseClass2 to BaseClass
    9. Remove the unused BaseClass2
    10. Run your unit tests…

    Repeat as required.

    Note this is pretty much the same procedure to use when you find some common code you feel should be all a single method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a old C/C++ class that i want to refactor and access from .net
I want to refactor some C# modules that read data from SQL Server 2008
I want to refactor this piece of code, it takes input from a form,
I want to refactor this mumbo jumbo of a method to make it more
I have read that to build multiple Maven projects in one step (with automatic
I have some code that I want to refactor. I have lots of methods
I want to refactor my model so I can properly write a unit test
I want to change the packages of multiple classes in my application. A nice
Let's say I'm starting out with this model: class Location < ActiveRecord::Base attr_accessible :company_name,
I want to refactor many similar controls that only differ in the value of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.