13
Move Field
Goal
Each field belongs to the class that owns its lifecycle; cross-class reaching disappears.
Before the refactoring
class Customer { plan; discountRate; }After the refactoringclass Plan { discountRate; }
class Customer { plan; /* discountRate accessed via plan */ }Savings
Class boundaries align with data ownership; mutations are local; refactoring becomes safer.
Note
Moving a field disturbs every reader — refactor in tooling-supported steps and add a temporary accessor on the original class while migrating.