重构名录:
第一部分:代码的坏味道(Bad smells in Code)
BS1: Duplicated Code(重复的代码)
BS2:Long Method(过长的函数)
BS3:Large Class(过大类)
BS4: Long Parameter List(过长参数列)
BS5:Divergent Change (发散式变化)
BS6:Shotgun Surgery (散弹式修改)
BS7: Feature Envy (依恋情节)
BS8: Data Clumps(数据泥团)
BS9: Primitive Obsession(基本型别偏执)
BS10: Switch Statements(Switch 惊悚现身)
BS11: Parallel Inheritance Hierarchies(平行继承体系)
BS12: Lazy Class(冗赘类)
BS13: Speculative Generality(夸夸其谈未来性)
BS14: Temporary Field(令人迷惑的暂时值域)
BS15: Message Chains(过度耦合的消息链)
BS16: Middle Man(中间转手人)
BS17: Inappropriate Intimacy(狎昵关系)
BS18: Alternative Classes with Different Interface
BS19: Incomplete Library Class(不完美的程序库类)
BS20: Data Class(纯数据类)
BS21: Refused Bequest(被拒绝的遗赠)
BS22: Comments(过多的注释)
第二部分:重新组织你的函数
1. Extract Method(提炼函数)
2. Inline Methods(将函数内联化)
3. Inline Temp(将临时变量内联化)
4. Replace Temp with Query
5. Introduce Explaining Variable
6. Split Temporary Variable
7. Remove Assignments to Parameters
8. Replace Method with Method Object
9. Substitute Algorithm
第三部分:在对象之间搬移特性
10. Move Method
11. Move Field
12. Extract Class
13. Inline Class
14. Hide Delegate
15. Remove Middle Man
16. Introduce Foreign Method
17. Introduce Local Extension
第四部分: 重新组织数据
18. Self Encapsulate Field (自封装值域)
19. Replace Data Value with Object(以对象取代数据)
20. Change Value to Reference(将实值对象改为引用对象)
21. Change Reference To Value(将引用对象改为实值对象)
22. Replace Array With Object(以对象取代数组)
23. Duplicate Observed Data(复制被监视数据)
第五部分:简化条件表达式
24. Decompose Conditional(分解条件式)
25. Consolidate Conditional Expression(合并条件式)
26. Consolidate Duplicate Conditional Fragments(合并重复条件片段)
27. Remove Control Flag
28. Replace Nested Conditional with Guard(以卫语句取代嵌套条件式)
29. Replace Condition with polymorphism(以多态取代条件式)
30. Introduce Null Object (引入null对象)
31. Introduce Assertion (引入断言)
第六部分:简化函数调用
32. Rename Method
33. Add Parameter
34. Remove Parameter
35. Separate Query from Modifier
36. Parameterize Method
37. Replace Parameter with Explicit Methods
38. Preserve Whole Object
39. Replace Parameter with Methods
40. Introduce Parameter Object
41. Remove Setting Method
42. Hide Method
43. Replace Constructor with Factory Method
44. Encapsulate Downcast
45. Replace Error Code with Exception
46. Replace Exception with Test
分享到:
相关推荐
Refactoring: Improving the Design of Existing Code
改善既有代码的设计。系统发展到一定阶段后,使用重构的方式,不改变系统的外部功能,只对内部的结构进行重新的整理。通过重构,不断的调整系统的结构,使系统对于需求的变更始终具有较强的适应能力。
Refactoring-Improving+the+Design+of+Existing+Code.pdf Refactoring-Improving+the+Design+of+Existing+Code.pdf
Refactoring(Improving the Design of Existing Code) 我加上了每个重构方法的书签,方便查阅
This eagerly awaited new edition has been fully updated to reflect crucial changes in the programming landscape.Refactoring, Second Edition,features an updated catalog of refactorings and includes ...
经典的书籍,系统的讲授了软件重构。。。。 用Java语言描述。。。
Refactoring Improving The Design of Existing Code 重构已有代码
Refactoring, improving software code, redesign, design tips, patterns, unit testing,
Refactoring-Improving the Design of Existing Code
Refactoring Improving The Design Of Existing Code
"Refactoring" was conceived in Smalltalk circles, but it wasn't long... The key to keeping code readable and modifiable is refactoring—for frameworks, in particular, but also for software in general.
重构 改善既有代码的设计 Refactoring Improving the Design of Existing Code
该书讨论如何在现有代码的基础上重构,并加入新代码的各种具体的思路和方法 有些机器解压后需要将pdf文件名改为1.pdf才能正确打开,感谢网友“风雨者”的反馈
经典丛书txt版. 《Refactoring: Improving the Design of Existing Code》
Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure. 任何傻瓜都可以写出计算机理解的代码...
Refactoring Improving the Designof Existing Code(中英文版)
博文链接:https://nlslzf.iteye.com/blog/234070
Refactoring: Improving the Design of Existing Code 重构领域必读书目,江湖地位不必多说,英文原版,高清。