Move Function / Move Method

Examine

Identify a function or method that you would like to move to a different module, class or namespace.

Prepare

Implement

If that doesn’t work, these are some manual steps:

At this point you have succeeded in you original aim - the function body is moved to a new place. However, clients of the original method will still be calling that one.

Clear

Follow up

Prompted by Code Smells

Relevant Learning Hours

Sources

Back to All Refactorings