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

Ruben Bohorquez rubenandrelo31 at gmail.com
Tue May 23 18:15:08 PDT 2023


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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230523/349ba633/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5800-ChangesToPushUpDown-RubenBohorquez-2023May23-22h10m-RABG.001.cs.st
Type: application/octet-stream
Size: 70 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230523/349ba633/attachment.obj>


More information about the Cuis-dev mailing list