[Cuis-dev] Move to instance/class method

Hernan Wilkinson hernan.wilkinson at 10pines.com
Thu Dec 12 10:23:38 PST 2019


Hi Leandro!
 great work!! It follows the design of others refactoring and also with
tests! Great job!! congratulations!

 It is on github now.

 There are a few things that would be great if you could do them:
1) When checking if the method references an instance variable, you are
checking only in the method class but not in its superclasses. You should
change
assertIsNotAccessingInstanceVariable: aMethodToMove

aMethodToMove methodClass instVarNames ....

with:
assertIsNotAccessingInstanceVariable: aMethodToMove

aMethodToMove methodClass allInstVarNames

and write a test for it :-)
2) When checking for senders:
a) that should be done by the refactoring and not the applier. In the case
there are senders a RefactoringWarning should be
signaled. RefactoringWarning is resumable and it is currently handled by
the applier to ask you if you want to continue or not.
b) do not raise the warning if the sender is only itself (and write a test
for it :-) )

 Let me know if you can do it!

Hernan

On Mon, Dec 9, 2019 at 2:34 AM Leandro Yampolsky via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Sorry, I am sending now the file with the tests. I assumed it would be on
> the changeset.
>
> Regards,
> Leandro
>
> El lun., 9 dic. 2019 a las 2:21, Leandro Yampolsky (<
> leandroyampolsky at gmail.com>) escribió:
>
>> Hi everyone.
>>
>> This is my first time posting here. I am sending a changeset that
>> includes a new refactoring to move a method to an instance or class method
>> (according to where it is), which I find could be useful at times.
>>
>> It does some basic checks: if the method references instance variables,
>> or if it has any local variable with the same name as an instance variable
>> in the target class, it can't be done and an error message displays
>> indicating that. Also, if there are any senders of the method in the same
>> class, a confirmation prompt appears warning that there are senders.
>>
>> Please, let me know if it needs to be changed in some way.
>>
>> Regards,
>> Leandro
>>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191212/730b86d0/attachment.htm>


More information about the Cuis-dev mailing list