Author |
Topic |
|
drzoom
Ketchup Master
Switzerland
57 Posts |
Posted - Oct 31 2006 : 03:54:25 AM
|
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
|
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 |
|
|
drzoom
Ketchup Master
Switzerland
57 Posts |
Posted - Oct 31 2006 : 1:04:07 PM
|
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
|
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Oct 31 2006 : 4:14:29 PM
|
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 |
|
|
jpizzi
Tomato Guru
USA
642 Posts |
Posted - Oct 31 2006 : 11:12:46 PM
|
Is it possible to "rename" to a new signature? |
Joe Pizzi |
|
|
drzoom
Ketchup Master
Switzerland
57 Posts |
Posted - Nov 01 2006 : 07:13:27 AM
|
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
|
|
|
drzoom
Ketchup Master
Switzerland
57 Posts |
Posted - Nov 01 2006 : 07:24:25 AM
|
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*:
- Class: Only the class where the method is declared.
- Bases: All bases of the class including multiple inheritance.
- Subclasses: All sub, subsub etc. classes of the class where the method is declared.
- 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 |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Nov 01 2006 : 07:49:46 AM
|
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 |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Nov 18 2013 : 3:25:19 PM
|
Change Signature was overhauled in build 2007 and now supports changes in a class hierarchy. |
|
|
|
Topic |
|