Pull up a method or Push up a method?
Hi all, According to the book Refactoring[1] you pull up a method but if you look at the refactoring options in a method, you'll see push up instead of pull up. See attached image. Is that a bug or a deliberate decision? Thanks [1] Refactoring: Improving the Design of Existing Code Martin Fowler Kent Beck John Brant William Opdyke Don Roberts Publisher: Addison Wesley -- Bernardo E.C. Sent from a cheap desktop computer in South America.
I think âpushâ makes more sense than âpullâ since the operation is performed on the class where the method resides and not the one it will end up in. Max On 12.08.2014, at 03:00, Bernardo Ezequiel Contreras <vonbecmann@gmail.com> wrote:
Hi all, According to the book Refactoring[1] you pull up a method but if you look at the refactoring options in a method, you'll see push up instead of pull up. See attached image.
Is that a bug or a deliberate decision?
Thanks
[1] Refactoring: Improving the Design of Existing Code Martin Fowler Kent Beck John Brant William Opdyke Don Roberts Publisher: Addison Wesley
-- Bernardo E.C.
Sent from a cheap desktop computer in South America. <a MenuMorph(931135488).jpeg>
For me pull means that you move from a subclass to a class while push is from a class to its superclass. Now it depends on it is implemented. Note that these refactorings were implemented long before the book (excellent BTW - I enjoyed reviewing it and martin told me that our reviews were excellent and forcing him to improve it). Stef On 12/8/14 03:00, Bernardo Ezequiel Contreras wrote:
Hi all, According to the book Refactoring[1] you pull up a method but if you look at the refactoring options in a method, you'll see push up instead of pull up. See attached image.
Is that a bug or a deliberate decision?
Thanks
[1] Refactoring: Improving the Design of Existing Code Martin Fowler Kent Beck John Brant William Opdyke Don Roberts Publisher: Addison Wesley
-- Bernardo E.C.
Sent from a cheap desktop computer in South America.
My recollection is that it got changed (in industry) because it made more sense contextually, that when looking at a particular method you would push it up the hierarchy vs. pull (I think I also recall that in the original RFB, you had to be on the superclass and then choose pull up - and it showed you potential methods you could pull? I might be mistaken - but I recall that it was quite awkward). The downside of the current terminology - is that pushing should also find similar peer methods (in other equivalent subclasses) and push them up as well. That is less obvious - than in the âpullâ terminology - as being at the top you can see all the equivalents and more obviously pull them all together. However, I think the current words are better - and it seems to be what has stuck now. Tim p.s. We really should start looking at introducing keystrokes for many of these refactorings in Pharo - definitely the extract and rename variants should be doable from the keyboard in the method pane. When you see our colleagues using IntelliJ (and even Eclipse) - its so much faster. On 12 Aug 2014, at 02:00, Bernardo Ezequiel Contreras <vonbecmann@gmail.com> wrote:
Hi all, According to the book Refactoring[1] you pull up a method but if you look at the refactoring options in a method, you'll see push up instead of pull up. See attached image.
Is that a bug or a deliberate decision?
Thanks
[1] Refactoring: Improving the Design of Existing Code Martin Fowler Kent Beck John Brant William Opdyke Don Roberts Publisher: Addison Wesley
-- Bernardo E.C.
Sent from a cheap desktop computer in South America. <a MenuMorph(931135488).jpeg>
participants (4)
-
Bernardo Ezequiel Contreras -
Max Leske -
stepharo -
Tim Mackinnon