source: https://refactoring.guru/course
Replace Method with Method Object
Encapsulate Collection
Encapsulate Collection , Encapsulation
Example:
Before(Wrong):
After(Correct):
After(Correct):
Refactoring Checklist
Replace Type Code with Subclasses
Example:
Example:
Before(Wrong):
After(Correct):
After(Correct):
Introduce Null Object
Example:
Before(Wrong):
After(Correct):
After(Correct):