[Cuis-dev] Push Down Improvements

Patricio Tourne Passarino patricio.tourne.passarino at proton.me
Wed Nov 2 05:54:13 PDT 2022


I have some ideas to improve Push Down Refactor and I was wondering if you could give me any feedback.
I'm Patricio Tourne Passarino and I'm studying Software Engineering at FIUBA (Facultad de Ingeniería de la Universidad de Buenos Aires). I was introduced to Cuis in my "Algorithms and Coding III" class and I thought of a modification that would be usefull in the following case:

I have a class "AClass" with two classes: "ASubclassOne" and "ASubclassTwo".
"AClass" has "aMessage" implemented:

> aMessage
>
> "AClass implementation"

"ASubclassOne" has "aMessage" implemented:

> aMessage
>
> "ASubclassOne implementation"

​I want to move "AClass" implementation of "aMessage" to all subclasses that don't have it implemented allready (without overwriting). Furthermore, instead of removing "aMessage" from ​"AClass", I want to change it to:

> aMessage
>
> self subclassResponsibility.

​

I propose Push Down has options for this alternative behaviour. I implemented a demonstration adding the option "Push Down 2.0" in method refactoring options. To reproduce the behaviour described previously, the changes file must be imported, then right click on "aMessage" in "AClass", in refactorings click on Push Down 2.0, then "Preserve" and then "Yes, clean it". This implementation also works for messages with parameters, as "aMessage:".

I'm looking forward for your feedback. Also, I would like to know where tests should go, as I wasn't able to find any testcases for the other refactors to use as reference.

Thank you for your time,

Patricio Tourne Passarino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20221102/3b4c972a/attachment-0001.htm>


More information about the Cuis-dev mailing list