Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Add method/change signature for derived classes.

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
GennadiyKorol Posted - Jul 16 2008 : 8:00:50 PM
In any object oriented project there is usually a base class - an interface and derived objects implementing that interface.

Let's take the classic example, Shape with virtual draw method. Circle and Rectangle are derived from it.

class Shape {

    virtual void draw() {}
};

class Rectangle : public Shape {

   void draw() {impl}
}

class Circle : public Shape {

   void draw() {impl}
}



Right now when invoking rename over the draw function in Shape class, visual assist will also rename the function in each derived class (even though one might prefer having a check box for that?).

But changing the method signature will only affect the Shape class. So we need to go through each derived class and modify the signature for the draw method again and again.

I would like to request adding a check box "Modify in derived classes" that would automatically change the signature of the overriden methods in the derived classes as well. If rename can do it, why can't change signature?


The same goes for the addition of new member functions. What if we want to add a new function to the Shape interface? We will then need to again add signature and implementation for that function in each derived class manually.

Also it would be nice to be able to remove functions from the base classes so that they are also deleted from every derived class (including the implementation).


I think this set of additions will totally remove the fear of refactoring interfaces in our code :)
4   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Nov 18 2013 : 3:29:03 PM
Change Signature was overhauled in build 2007 and now supports changes to a class hierarchy.
feline Posted - Aug 06 2008 : 10:20:03 AM
Probably not in the short term. Currently VA cannot tell which overload of a function you are calling, and it cannot correctly match up the declarations and implementations for an overloaded function.

So VA is going to have some problems correctly determining which functions from the interface have already been implemented. The problem gets even more complex when you consider multiple inheritance, a complex tree, and several interfaces.
Greg Posted - Aug 04 2008 : 8:21:29 PM
quote:
We have a very similar feature request about member functions:

case=8117

This case is about a refactoring you can trigger on a function in the base class. It will produce a dialog listing all derived classes, and you can select the classes you want to add the function to.


Is there also going to be the option to drive it the other way around?

For instance, in eclipse working on Java you can for a class say implement interfaces and it will list out those methods from interfaces you have not yet implemented for you to select which ones you wish to implement.

This would be useful when implementing new children for an existing interface, rather than implementing new parts of an interface for existing children.
accord Posted - Jul 17 2008 : 5:19:54 PM
I like your ideas :) and we have feature requests for similar tasks:

Modify change signature in derived classes is

case=3373

Remove function declaration / implementation is

case=1101

which covers removing them from derived classes also.

We have a very similar feature request about member functions:

case=8117

This case is about a refactoring you can trigger on a function in the base class. It will produce a dialog listing all derived classes, and you can select the classes you want to add the function to.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000