Introduction to refactoring, covering the SOLID principles, some examples of code smells and refactoring examples.
SOLID OO design principles:
- Single Responsibility Principle
- Open Closed Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
Code Smells:
- Comments
- Long Method
- Long Parameter List
- Duplicated Code
- Large Class
- Type Embedded in Name
- Uncommunicative Name
- Inconsistent Names
- Dead Code
- Speculative Generality
Refactorings:
- Rename Method
- Extract Method
- Replace Temp With Query
- Introduce Parameter Object
- Extract Class
- Extract Subclass
- Replace Parameter with Method
- Substitute Algorithm