Forced refactoring

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Forced refactoring

Rick Hedin
I am thrown by this behavior, perhaps inappropriately.
 
I am working on the view for my application.  For a while, I had an instance variable "font" with "font" and "font:" access methods.  I decided my variable would more appropriately be named "savedFont" so I proceeded to make that change. 
 
When I tried to rename the "font" method, or to remove it, I got a complaint that the method was called in lots of other places,and did I want to proceed. 
 
This is a purely local function, that only exists in my view.  I am not overriding a method that I inherited.  Is this an artifact of the way the IDE is written, noting that the name is the same and thinking that there is a relationship?  I am anxious not to "fan out" changes into other parts of the code. 
 
Can someone give me a clear understanding of what's going on?  I don't know how to proceed.
 
 
              Regards, Rick

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Forced refactoring

Steven Kelly
Yes, it's assuming that there might be senders of that method from outside your class, which could of course be anywhere in the system. Since there are many other #font[:] messages defined in the system, it's picking those up too.
 
In the Settings you can choose to show refactoring changes before they are executed. You can then accept to proceed with the refactoring when you see the warning dialog, and you will be shown another dialog with a list of all the methods that will be refactored. You can select a method you don't want to change and from its pop-up menu remove it from the list to be refactored, or even better, remove that whole class or whole namespace. Not the world's best UI, and there may be a better way to use it, but it's worked on the relatively rare occasions when I've needed it.
 
HTH,
Steve


From: [hidden email] on behalf of Rick Hedin
Sent: Sun 17/04/2011 19:19
To: vwnc NC
Subject: [vwnc] Forced refactoring

I am thrown by this behavior, perhaps inappropriately.
 
I am working on the view for my application.  For a while, I had an instance variable "font" with "font" and "font:" access methods.  I decided my variable would more appropriately be named "savedFont" so I proceeded to make that change. 
 
When I tried to rename the "font" method, or to remove it, I got a complaint that the method was called in lots of other places,and did I want to proceed. 
 
This is a purely local function, that only exists in my view.  I am not overriding a method that I inherited.  Is this an artifact of the way the IDE is written, noting that the name is the same and thinking that there is a relationship?  I am anxious not to "fan out" changes into other parts of the code. 
 
Can someone give me a clear understanding of what's going on?  I don't know how to proceed.
 
 
              Regards, Rick

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Forced refactoring

Rick Hedin
I found the "show me the refactoring changes you want to make" setting.
 
That makes sense.  I am coming from a C/C++ world, where you always know what kind of object you are sending a message to.  I came here for the flexibility, and this is a consequence.
 
Thanks, Steve.

On Sun, Apr 17, 2011 at 11:40 AM, Steven Kelly <[hidden email]> wrote:
Yes, it's assuming that there might be senders of that method from outside your class, which could of course be anywhere in the system. Since there are many other #font[:] messages defined in the system, it's picking those up too.
 
In the Settings you can choose to show refactoring changes before they are executed. You can then accept to proceed with the refactoring when you see the warning dialog, and you will be shown another dialog with a list of all the methods that will be refactored. You can select a method you don't want to change and from its pop-up menu remove it from the list to be refactored, or even better, remove that whole class or whole namespace. Not the world's best UI, and there may be a better way to use it, but it's worked on the relatively rare occasions when I've needed it.
 
HTH,
Steve


From: [hidden email] on behalf of Rick Hedin
Sent: Sun 17/04/2011 19:19
To: vwnc NC
Subject: [vwnc] Forced refactoring

I am thrown by this behavior, perhaps inappropriately.
 
I am working on the view for my application.  For a while, I had an instance variable "font" with "font" and "font:" access methods.  I decided my variable would more appropriately be named "savedFont" so I proceeded to make that change. 
 
When I tried to rename the "font" method, or to remove it, I got a complaint that the method was called in lots of other places,and did I want to proceed. 
 
This is a purely local function, that only exists in my view.  I am not overriding a method that I inherited.  Is this an artifact of the way the IDE is written, noting that the name is the same and thinking that there is a relationship?  I am anxious not to "fan out" changes into other parts of the code. 
 
Can someone give me a clear understanding of what's going on?  I don't know how to proceed.
 
 
              Regards, Rick



--
I insist on rapport!

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Forced refactoring

Niall Ross
Dear Rick,
    Steve's method works.  Other ways are:

1) If you find that the fan-out and the non-fan-out (the genuine
intended changes) are so great that selecting the refactorings before
executing is tedious, you can instead load the RBDynamicRefactoringUI.  
This will cause the dialog you saw to offer a third option and its UI
can be used

a) to select which call sites to refactor (individually, by class, ....  )

b) to run code and have the system identify the correct call sites to
change dynamically

The text you will be shown when you invoke this 3rd option tells you
something about Method Wrappers.  Read and decide whether you want this
loaded in your image all the time or only on those probably rare
occusions when you actually use it.

2) (Trivially) As well as / instead of class or namespace, your fan-out
may have a natural relationship to your code components.  If so, you can
save your image, do the refactoring, save the package(s) in which all
changes are sensible, close unsaved and reopen, then reload
component(s).  Sometimes that will be the fastest way.

HTH.

>I found the "show me the refactoring changes you want to make" setting.
>
>That makes sense.  I am coming from a C/C++ world, where you always know
>what kind of object you are sending a message to.  I came here for the
>flexibility, and this is a consequence.
>
>Thanks, Steve.
>
>On Sun, Apr 17, 2011 at 11:40 AM, Steven Kelly <[hidden email]> wrote:
>
>  
>
>> Yes, it's assuming that there might be senders of that method from
>>outside your class, which could of course be anywhere in the system. Since
>>there are many other #font[:] messages defined in the system, it's picking
>>those up too.
>>
>>In the Settings you can choose to show refactoring changes before they are
>>executed. You can then accept to proceed with the refactoring when you see
>>the warning dialog, and you will be shown another dialog with a list of all
>>the methods that will be refactored. You can select a method you don't want
>>to change and from its pop-up menu remove it from the list to be refactored,
>>or even better, remove that whole class or whole namespace. Not the world's
>>best UI,
>>
I hope to integrate some improvements in 7.9.

                Yours faithfully
                   Niall Ross

>>and there may be a better way to use it, but it's worked on the
>>relatively rare occasions when I've needed it.
>>    
>>
>>HTH,
>>Steve
>>
>>------------------------------
>>*From:* [hidden email] on behalf of Rick Hedin
>>*Sent:* Sun 17/04/2011 19:19
>>*To:* vwnc NC
>>*Subject:* [vwnc] Forced refactoring
>>
>>  I am thrown by this behavior, perhaps inappropriately.
>>
>>I am working on the view for my application.  For a while, I had an
>>instance variable "font" with "font" and "font:" access methods.  I decided
>>my variable would more appropriately be named "savedFont" so I proceeded to
>>make that change.
>>
>>When I tried to rename the "font" method, or to remove it, I got a
>>complaint that the method was called in lots of other places,and did I want
>>to proceed.
>>
>>This is a purely local function, that only exists in my view.  I am not
>>overriding a method that I inherited.  Is this an artifact of the way the
>>IDE is written, noting that the name is the same and thinking that there is
>>a relationship?  I am anxious not to "fan out" changes into other parts of
>>the code.
>>
>>Can someone give me a clear understanding of what's going on?  I don't know
>>how to proceed.
>>
>>
>>              Regards, Rick
>>
>>    
>>
>
>
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>vwnc mailing list
>[hidden email]
>http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>  
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc