|
|
|
First, Dr. Jones
can check for guards – obvious reasons that one wouldn’t want to do the
refactoring.
|
|
In this case,
Dr. Jones can check for name conflicts, and that you’re not trying to move a
constructor.
|
|
Also a different
set of rules apply for move method if the source and target classes are
related by inheritance.
|
|
Note that
these`guards’ don’t completely check that the refactoring preserves the
program’s behavior (since that would involve much more difficult analyses).
|
|
Rather these are
more like sanity checks to help the programmer avoid refactoring mistakes.
|
|
|
|
(Dr. Jones can
remind the programmer to check the more difficuly safety conditions when it’s
time to implement the refactorings.
This runs the risk, however, of allowing the programmer to plan unsafe
refactorings with Dr. Jones.)
|