Refactor towards OOSD
# Refactoring Classes
Click
Refactoring(control + T)Click
Refactor this...Click
MoveName a new class name, and change the visibility of this new class:
- Click
Yesto create a new class:
# Generate Constructors
- Click
Code - Click
Generate(command + N) - Select
Constructor - A constructor with three parameters will be created:
The constructor looks like this: (those three signatures are fields of the class)

# Change Method Signature
- Click
Refactoring(control + T) - Click
Refactor this... - Click
Change Signature - Then one can add or delete signatures
# Find Usage
- Right click the targeted class/method name
- Click
Find Usages
# Extract Field
- Click
Refactoring(control + T) - Click
Refactor this... - Click
Field - Can choose to initialize it in a constructor and replace all occurrences

上次更新: 2021/12/31, 15:34:56