On 6 Aug 2010, at 15:59, laurent laffont wrote:
If I understand what you want correctly, can you try to select the
superclass, then refactor class>>create subclass. You give the name
and then you select all subclasses that you want to set as
subclasses of the new class.
Is it right ?
Not quite - that assumes that there is a reasonable common superclass
(other than Object or WAComponent) - although you can get to that
position with a bit of copy/paste of superclass names. THEN - if you
do create subclass, that just creates a superclass for your selected
classes but DOESN'T offer to promote any common methods or instance
variables, that is then left to the reader to sort out.
The operation, Refactor Create Superclass is closer to the operation
that I want (and I think Lucas may have fixed it so that when it
offers to promote methods and ivars you can remove unwanted
promotions) HOWEVER - it only does this for a single class, leaving
you to manually fix up your other classes by yourself.
So its a combination of the two.
This is a common thing (and really easy in the Java world - it takes
seconds - and I suspect we have the engine to do this in Smalltalk)
that I'm surprised its not there (but totally understand that the
community has been stretched on other things - and I'm hoping to rally
support. There are some basic things that most developers I have met
expect - and this is one of them (along with extract method - which we
have - but no keystroke for it, assign temporary - again which we have
but no keystroke for it, and inline temporary - which we kind of have
but its a bit awkward to use and again there is no keystroke for it).
I also find that the code reformatter applied after a refactoring is a
bit rough as well (and this is possibly why people hold off
refactoring as well).
I don't want to knock too much - the building blocks appear to be
there, its just about building awareness and enthusiastic volunteers
to move things forward (without impacting the other important work
going on).
Tim
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project