about push up and pull up

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

about push up and pull up

Stephane Ducasse-3
Hi guys

I wonder why we have push up method and pull up instance variables.
I remember that long time ago we got a discussion but I forgot. 
Do you remember?

Stef (writing chapters for new books for total newbies: yes the future pharoers)
Reply | Threaded
Open this post in threaded view
|

Re: about push up and pull up

CyrilFerlicot

On sam. 25 mars 2017 at 20:28, Stephane Ducasse <[hidden email]> wrote:
Hi guys

I wonder why we have push up method and pull up instance variables.
I remember that long time ago we got a discussion but I forgot. 
Do you remember?

Stef (writing chapters for new books for total newbies: yes the future pharoers)
I opened an issue some time ago 


--
Cheers
Cyril Ferlicot
Reply | Threaded
Open this post in threaded view
|

Re: about push up and pull up

Stephane Ducasse-3
Tx cyril. I'm remember that there was reason but it looks obscure now :)

On Sat, Mar 25, 2017 at 8:32 PM, Cyril Ferlicot <[hidden email]> wrote:

On sam. 25 mars 2017 at 20:28, Stephane Ducasse <[hidden email]> wrote:
Hi guys

I wonder why we have push up method and pull up instance variables.
I remember that long time ago we got a discussion but I forgot. 
Do you remember?

Stef (writing chapters for new books for total newbies: yes the future pharoers)
I opened an issue some time ago 


--
Cheers
Cyril Ferlicot

Reply | Threaded
Open this post in threaded view
|

Re: about push up and pull up

John Brant-2
In reply to this post by Stephane Ducasse-3
> On Mar 25, 2017, at 2:27 PM, Stephane Ducasse <[hidden email]> wrote:
>
> Hi guys
>
> I wonder why we have push up method and pull up instance variables.
> I remember that long time ago we got a discussion but I forgot.
> Do you remember?
>
> Stef (writing chapters for new books for total newbies: yes the future pharoers)

In the original RefactoringBrowser, if you wanted to move an instance variable up in the hierarchy, you would select the superclass and perform pull up instance variable. It would then open a dialog where you chose what subclass instance variable you wanted to pull up. Since we were at the superclass in the browser instead of the instance variable, I chose pull up instance variable for the name. At that time, we hadn’t implemented context selection menu options for the class definition, so we didn’t have a way to select an instance variable in the browser without opening a dialog.

Later, I implemented push up method. In this case, the browser already supported selecting methods, so it didn’t make sense to have the user move to the superclass, perform pull up method, and then select the method you want to pull up from a dialog.

Essentially, the push vs. pull naming was based on where you were in the browser. If the thing to move wasn’t where you were in the browser, then pull was used — you would reach over to the other place and pull it to you. However, if the thing was currently where you were in the browser, then you would push it to the new location.

Of course, the current browser doesn’t follow my push vs. pull naming convention. When you pull up an instance variable, you need to have the class that defines the variable selected.


John Brant
Reply | Threaded
Open this post in threaded view
|

Re: about push up and pull up

Stephane Ducasse-3
Tx John for the historical perspective.I see. 
I would like to have a uniform naming: "move method up :)"  
We will revisit everything with Calypso. 
And fix some problems: In Pharo we broke the precondition that pulling up a method should only work if the state it accessed is already in the destination. 
We want also to have a layer (refactoring not accessing UI element) and a layer on top to manage interaction with the user. Right now this is mixed up. 
We should be able to invoke refactorings without UI. 
Stef

On Sun, Mar 26, 2017 at 12:08 AM, John Brant <[hidden email]> wrote:
> On Mar 25, 2017, at 2:27 PM, Stephane Ducasse <[hidden email]> wrote:
>
> Hi guys
>
> I wonder why we have push up method and pull up instance variables.
> I remember that long time ago we got a discussion but I forgot.
> Do you remember?
>
> Stef (writing chapters for new books for total newbies: yes the future pharoers)

In the original RefactoringBrowser, if you wanted to move an instance variable up in the hierarchy, you would select the superclass and perform pull up instance variable. It would then open a dialog where you chose what subclass instance variable you wanted to pull up. Since we were at the superclass in the browser instead of the instance variable, I chose pull up instance variable for the name. At that time, we hadn’t implemented context selection menu options for the class definition, so we didn’t have a way to select an instance variable in the browser without opening a dialog.

Later, I implemented push up method. In this case, the browser already supported selecting methods, so it didn’t make sense to have the user move to the superclass, perform pull up method, and then select the method you want to pull up from a dialog.

Essentially, the push vs. pull naming was based on where you were in the browser. If the thing to move wasn’t where you were in the browser, then pull was used — you would reach over to the other place and pull it to you. However, if the thing was currently where you were in the browser, then you would push it to the new location.

Of course, the current browser doesn’t follow my push vs. pull naming convention. When you pull up an instance variable, you need to have the class that defines the variable selected.


John Brant