Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Add method/change signature for derived classes.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

GennadiyKorol
Ketchup Master

Israel
54 Posts

Posted - Jul 16 2008 :  8:00:50 PM  Show Profile  Reply with Quote
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 :)

Correctness might be a theoretical concept but incorrectness has practical implications.

Edited by - GennadiyKorol on Jul 16 2008 8:02:41 PM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 17 2008 :  5:19:54 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

Greg
New Member

Australia
6 Posts

Posted - Aug 04 2008 :  8:21:29 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19025 Posts

Posted - Aug 06 2008 :  10:20:03 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 18 2013 :  3:29:03 PM  Show Profile  Reply with Quote
Change Signature was overhauled in build 2007 and now supports changes to a class hierarchy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000