[Cuis-dev] Proposed changes to the Push up / Push down refactors

Gerald Klix cuis.01 at klix.ch
Tue May 23 23:46:25 PDT 2023


On 5/24/23 3:15 AM, Ruben Bohorquez via Cuis-dev wrote:
> Hello everyone! One thing that I've been having to do a lot recently is
> create a new hierarchy of subclasses with an abstract superclass, and thus
> having to push down a method to all subclasses *while keeping the method in
> the superclass*, usually implemented as subclassResponsibility.
> I've found the existing "push down" refactor to be lacking in that sense,
> since it always deletes the original method (and "push up" does tattoo,
> although it hasn't been that annoying to me just yet).
> So I modified both push methods to prompt a pop up asking the user what
> they want to do with the original method. The options are delete it, keep
> it as it is, or replace it with "self subclassResponsibility" or "super
> methodSelector" for push down / up respectively. I've tested it a bit and
> it works like a charm.
> Bear in mind that I'm fairly new to Smalltalk, so there may be some aspects
> of the code that can be improved upon. Especially style / good practices
> things, like some collaborator names that just don't sit right with me.
> Have a nice night everyone!
>
>
When I start new class hierarchy, I find myself in that situation
at least once a day.
IHMO, this change-set is a much needed improvement.

If the need arises, I will test your change-set.


Best Regards,

Gerald


More information about the Cuis-dev mailing list