Move methods
From CSSEMediaWiki
(Difference between revisions)
(New page: A method is, or will be, using or used by more features of another class than the class on which it is defined. Create a new method with a similar body in the class it uses most. Either t...) |
|||
Line 2: | Line 2: | ||
Create a new method with a similar body in the class it uses most. Either turn the old method into a simple delegation, or remove it altogether. | Create a new method with a similar body in the class it uses most. Either turn the old method into a simple delegation, or remove it altogether. | ||
+ | |||
+ | [[Image:07fig01.gif]] | ||
from http://sourcemaking.com/refactoring/move-method | from http://sourcemaking.com/refactoring/move-method |
Latest revision as of 20:37, 20 October 2010
A method is, or will be, using or used by more features of another class than the class on which it is defined.
Create a new method with a similar body in the class it uses most. Either turn the old method into a simple delegation, or remove it altogether.