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
 Technical Support
 1540: Change Signature should change subclass too
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

drzoom
Ketchup Master

Switzerland
57 Posts

Posted - Oct 31 2006 :  03:54:25 AM  Show Profile  Reply with Quote
If I change the signature in a superclass, the signature of all overriding methods should change too:


class A {
public:
virtual void foo() = 0;
};
class B : public A {
public:
virtual void foo();
};
class C : public A {
public:
virtual void foo();
};


When I change the signature of the virtual abstract foo() in the superclass. The signatures of the overriding methods in B and C should change too.


best regards
Tobias

Edited by - drzoom on Oct 31 2006 04:19:32 AM

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Oct 31 2006 :  10:26:07 AM  Show Profile  Reply with Quote
Why should it? I understand what you are saying, but VA has no way of knowing this is what you intend.

I have often used code that looks like this, where the virtual function is overloaded.

I would suggest using Find References in the base class A, which will list all references, allowing you to easily jump to the declaration in both B and C. You can then do the same Change Signature 3 times, one for each class.

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

drzoom
Ketchup Master

Switzerland
57 Posts

Posted - Oct 31 2006 :  1:04:07 PM  Show Profile  Reply with Quote
I have this problem not with 2 subclasses. The common situation I have, when I wish to have a such feature, is with 20+ subclasses.

.oO( ok... I guess the answer... use search/replace... )

best regards
Tobias
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Oct 31 2006 :  4:14:29 PM  Show Profile  Reply with Quote
It is not the number of sub classes, it is more the question "what should Change Signature do?"

Rename scans the sub classes and updates them, but currently Change Signature does not. It makes sense that rename should scan the child classes. I am not so sure that it makes sense for Change Signature to scan the child classes.

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

jpizzi
Tomato Guru

USA
642 Posts

Posted - Oct 31 2006 :  11:12:46 PM  Show Profile  Reply with Quote
Is it possible to "rename" to a new signature?

Joe Pizzi
Go to Top of Page

drzoom
Ketchup Master

Switzerland
57 Posts

Posted - Nov 01 2006 :  07:13:27 AM  Show Profile  Reply with Quote
Hm... why not keep the old "change signature" and create a new function "change signature in all classes" ?

I think VAX is like a rocket engine for the software developer. Changing 30+ subclasses "by hand" is slow (and boring). So this is IMO exactly one of this features VAX should support , isn't it?


best regards
Tobias
Go to Top of Page

drzoom
Ketchup Master

Switzerland
57 Posts

Posted - Nov 01 2006 :  07:24:25 AM  Show Profile  Reply with Quote
Hm... or in general: Why not let the developer decide, how big the scope of some refactoring methods is?

This is only true for symbols where the scope isn't clear. E.g. member methods. For all other symbols, the scope is IMO clear.

Scope Regions can be any combination of*:

  1. Class: Only the class where the method is declared.

  2. Bases: All bases of the class including multiple inheritance.

  3. Subclasses: All sub, subsub etc. classes of the class where the method is declared.

  4. User: All places where the method is used in the code.



This scope is applicable for "rename" and "signature change".


*=edited after next reply.

best regards
Tobias

Edited by - drzoom on Nov 01 2006 08:14:37 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Nov 01 2006 :  07:49:46 AM  Show Profile  Reply with Quote
I was probably a little hasty in my first response, apologies for that. I have put in a feature request for this, since you do make a sensible argument.

case=3373

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:25:19 PM  Show Profile  Reply with Quote
Change Signature was overhauled in build 2007 and now supports changes in 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