Jump to content

Insert class in hierarchy


Recommended Posts

I have a project with a large number of classes that inherit from a common parent.  The parent has a method that I want to override in all the child classes.  The override method will be the same for all children.  Instead of creating individual overrides in each child, I want to create a new class that inherits from the parent and only includes the common override method.  I then want to change all the children that currently inherit from the parent to now inherit from this new class.  That allows them all to get the new override method.

What I don't want to do is manually change the inheritance on each of these child classes.  Instead I want to 'insert' the new class between the parent and all the children.

 

Does anyone know of an easy way to do this or maybe have a tool they scripted to solve this?

 

thanks,

-John

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.