Refactoring Improving the Design of Existing Code Second Edition
- 6.1 提炼函数:
- 重构前 extract_function.go
- 重构后 refactoring.go
- 6.2 内联函数:
- 重构前 inline_function.go
- 重构后 refactoring.go
- 6.3 提炼变量:
- 重构前 extract_variable.go
- 重构后 refactoring.go
- 6.4 内联变量:
- 重构前 inline_variable.go
- 重构后 refactoring.go
- 6.5 改变函数声明:
- 简单做法
- 迁移式做法
- 6.9 函数组合成类:
- 7.3 以对象取代基本类型:
- 10.4 用多态处理变体逻辑: