Refactoring Improving the Design of Existing Code
2013-03-31 00:00
405 查看
1. Bad smells in code
2. Duplicated code
when same expression, Extract Method
sibling in subclass,extract method and pulll up method in super class
similar code ,but not identical,will extract Template method
3. Long Method
long Method is difficult understand.
small Method name will explain function.
logic in loop will extract method
replace method with method object
decompose conditional
4. Large Class
many instance and duplicated code will happen in large class
extarct subclass
extarct interface group by function
duplicate observed Data
5. Long Parameter List
difficulte to understand paramter
Preserve whole object
6. Divergent Change
7. Shotgun Surgery
Move method and move field in one class
8. Feature Envy
9. Data Clumps
10. Primitive Obsession
record type
primitive types
11. Switch Statements
cause by type code
replace type code with subclasses
replace type with state/strategy
replace conditional with polymorphism
replace parameter with Explicit methods
12. Parallel inheritance hieratchies
same pre in other class is bad smell
13. Lazy Class
14. Speculative generality
2. Duplicated code
when same expression, Extract Method
sibling in subclass,extract method and pulll up method in super class
similar code ,but not identical,will extract Template method
3. Long Method
long Method is difficult understand.
small Method name will explain function.
logic in loop will extract method
replace method with method object
decompose conditional
4. Large Class
many instance and duplicated code will happen in large class
extarct subclass
extarct interface group by function
duplicate observed Data
5. Long Parameter List
difficulte to understand paramter
Preserve whole object
6. Divergent Change
7. Shotgun Surgery
Move method and move field in one class
8. Feature Envy
9. Data Clumps
10. Primitive Obsession
record type
primitive types
11. Switch Statements
cause by type code
replace type code with subclasses
replace type with state/strategy
replace conditional with polymorphism
replace parameter with Explicit methods
12. Parallel inheritance hieratchies
same pre in other class is bad smell
13. Lazy Class
14. Speculative generality
相关文章推荐
- 读重构 (Refactoring:Improving the Design of Existing Code)
- Refactoring_Improving_the_design_of_existing_code--笔记
- 重温:Martin Fowler的Refactoring Improving the Design of Existing code
- 笔记-重构-改善既有代码的设计(Refactoring - Improving the Design of Existing Code)
- 重读《重构》Refactoring Improving the Design of Existing Code
- Refactoring: Improving the Design of Existing Code
- 重构-改善既有代码的设计Refactoring - Improving the Design of Existing Code
- BookNote: Refactoring - Improving the Design of Existing Code
- 代码的规范化:《Refactoring: Improving the Design of Existing Code》
- Refecing Improving the Design of Existing Code reading comments(一)
- Refactoring HTML: Improving the Design of Existing Web Applications
- Refecing Improving the Design of Existing Code reading comments(二)
- Refecing Improving the Design of Existing Code reading comments(三)
- {Refractoring - Improving the design of existing code} - 1999
- 《Refactoring-Improving the Design of Existing Code》读书笔记
- 【RefactoringCode】The description of the refactoring book
- 【RefactoringCode】The description of the refactoring book
- the design principles and code analysis of hibernate lazy loading
- the thinker of code complete -- Refactoring
- Refactoring as a way to improve the existing design