重构 改善既有代码的设计 评注版PDF电子书下载
- 电子书积分:14 积分如何计算积分?
- 作 者:马丁·福勒(MartinFowler),肯特·贝克(KentBeck),约翰·布兰特(JohnBrant),威廉·奥迪克(WilliamOpdyke),唐·罗伯茨(DonRoberts)编著
- 出 版 社:北京:电子工业出版社
- 出版年份:2011
- ISBN:9787121134500
- 页数:430 页
Chapter 1 Refactoring,a First Example(新增批注共21条) 1
The Starting Point 2
The First Step in Refactoring 9
Decomposing and Redistributing the Statement Method 10
Replacing the Conditional Logic on Price Code with Polymorphism 30
Final Thoughts 41
Chapter 2 Principles in Refactoring(新增批注共1 1条) 43
Defining Refactoring 43
Why Should You Refactor? 45
When Should You Refactor? 48
What DO I Tell My Manager? 51
Problems with Refactoring 53
Refactoring and Design 57
Refactoring and Performance 60
Where Did Refactoring Come From? 61
Chapter 3 Bad Smells in Code(by Kent Beck and Martin Fowler)(新增批注共17条) 65
Duplicated Code 66
Long Method 67
Large Class 70
Long Parameter List 71
Divergent Change 73
Shotgun Surgery 74
Feature Envy 74
Data Clumps 75
Primitive Obsession 76
Switch Statements 76
Parallel Inheritance Hierarchies 77
Lazy Class 77
Speculative Generality 78
Temporary Field 78
Message Chains 79
Middle Man 81
Inappropriate Intimacy 82
Alternative Classes with Different Interfaces 82
Incomplete Library Class 83
Data Class 83
Refused Bequest 84
Comments 84
Chapter 4 Building Tests(新增批注共2条) 87
The Value of Self.testing Code 87
The JUnit Testing Framework 89
Adding More Tests 97
Chapter 5 Toward a Catalog of Refactorings(新增批注共1条) 103
Format of the Refactorings 103
Finding References 105
How Mature Are These Refactorings? 106
Chapter 6 Composing Methods(新增批注共9条) 109
Extract Method 110
Inline Method 117
Inline Temp 118
Replace Temp with Query 119
Introduce Explaining Variable 124
Split Temporary Variable 128
Remove Assignments to Parameters 130
Replace Method with Method Object 134
Substitute Algorithm 137
Chapter 7 Moving Features Between Objects(新增批注共12条) 139
Move Method 139
Move Field 144
Extract Class 147
Inline Class 151
Hide Delegate 153
Remove Middle Man 156
Introduce Foreign Method 158
Introduce Local Extension 160
Chapter 8 Organizing Data(新增批注共9条) 167
Self Encapsulate Field 168
Replace Data Value with Object 172
Change Value to Reference 175
Change Reference to Value 179
Replace Array with Object 181
Duplicate Observed Data 186
Change Unidirectional Association to Bidirectional 194
Change Bidirectional Association to Unidirectional 197
Replace Magic Number with Symbolic Constant 200
Encapsulate Field 201
Encapsulate Collection 202
Replace Record with Data Class 211
Replace Type Code with Class 211
Replace Type Code with Subclasses 217
Replace Type Code with State/Strategy 220
Replace Subclass with Fields 225
Chapter 9 Simplifying Conditional Expressions(新增批注共6条) 229
Decompose Conditional 229
Consolidate Conditional Expression 231
Consolidate Duplicate Conditional Fragments 234
Remove Contr01 Flag 236
Replace Nested Conditional with Guard Clauses 240
Replace Conditional with Polymorphism 245
Introduce Null Object 249
Introduce Assertion 258
Chapter 10 Making Method Calls Simpler(新增批注共14条) 263
Rename Method 264
Add Parameter 266
Remove Parameter 267
Separate Query from Modifier 269
Parameterize Method 273
Replace Parameter with Explicit Methods 277
Preserve Whole Object 280
Replace Parameter with Method 283
Introduce Parameter Object 286
Remove Setting Method 293
Hide Method 296
Replace Constructor with Factory Method 297
Encapsulate Downcast 301
Replace Error Code with Exception 303
Replace Exception With Test 308
Chapter 11 Dealing with Generalization(新增批注共6条) 313
Pull Up Field 313
Pull Up Method 315
Pull Up Constructor Body 317
Push Down Method 320
Push Down Field 321
Extract Subclass 322
Extract Superclass 327
Extract Interface 331
Collapse Hierarchy 334
Form Template Method 335
Replace Inheritance with Delegation 342
Replace Delegation with Inheritance 345
Chapter 12 Big Refactorings(by Kent Beck and Martin Fowler)(新增批注共11条) 349
Tease Apart Inheritance 351
Convert Procedural Design to Objects 358
Separate Domain from Presentation 363
Extract Hierarchy 367
Chapter 13 Refaetoring,Reuse,and Reality(by William Opdyke)(新增批注共8条) 373
A Reality Check 374
Why Are Developers Reluctant to Refactor Their Programs? 375
A Reality Check(Revisited) 388
Resources and References for Refactoring 389
Implications Regarding Software Reuse and Technology Transfer 390
A Final Note 391
References 391
Chapter 14 Refactoring Tools(by Don Roberts and John Brant) 395
Refactoring with a Tool 395
Technical Criteria for a Refactoring Tool 397
Practical Criteria for a Refactoring Tool 399
Wrap Up 401
Chapter 15 Putting It All Together(by Kent Beck)(新增批注共2条) 403
References 407
List of Soundbites 411
Index 413
- 《改善体质抗癌法》(日)济阳高穗著 2020
- 《养小录 学海堂彩绘评注版》(清)顾仲著 2018
- 《西湖梦寻评注》俞琼颖 2018
- 《新基建 数字经济重构经济增长新格局》袁国宝著 2020
- 《旧城改造 理性转型与权力重构》(中国)黄晴 2019
- 《深度区块链 用技术重构世界》庞宇雄著 2020
- 《转型与重构 近代西安城市空间结构演变》任云英著 2019
- 《宋词三百首评注 典藏版 上》(清)上疆村民编选;王水照等评注;倪春军辑评 2018
- 《意志视角下私法理论与体系的重构》王森波著 2019
- 《中华民族文化自信的变迁与重构 1919-2018》李涛著 2019
- 《刺杀肯尼迪》(美)比尔·奥赖利(美)马丁·杜加尔德 2019
- 《数学思维训练营 马丁·加德纳的趣味数学题》卢源,李凌,朱惠霖责任编辑;林自新,谈祥柏译;(美国)马丁·加德纳 2019
- 《自律》胡莉萍责编;郑毓倩译者;(波兰)马丁·麦德斯 2019
- 《我有一片星空》(英)马丁·贝利者徐辛未 2020
- 《赌徒恺撒》(德)马丁·耶内(Martin Jehne)著 2019
- 《“谋杀”的黄金时代:英国侦探俱乐部之谜》(英)马丁·爱德华兹(Martin Edwards)著 2020
- 《丘吉尔 语言的力量》(英)马丁·吉尔伯特著 2019
- 《宇宙行星大揭秘》(西)巴勃罗·马丁·阿维拉 2020
- 《儿童绘本创作指南 讲故事的视觉艺术》(英)马丁·塞利斯伯里,莫拉格·斯特尔斯著;李文娟译 2018
- 《吉他世界经典名曲二重奏 简易改编版原版引进》马丁·黑格尔改编;陆文逸译 2018
- 《电子测量与仪器》人力资源和社会保障部教材办公室组织编写 2009
- 《少儿电子琴入门教程 双色图解版》灌木文化 2019
- 《指向核心素养 北京十一学校名师教学设计 英语 七年级 上 配人教版》周志英总主编 2019
- 《北京生态环境保护》《北京环境保护丛书》编委会编著 2018
- 《指向核心素养 北京十一学校名师教学设计 英语 九年级 上 配人教版》周志英总主编 2019
- 《通信电子电路原理及仿真设计》叶建芳 2019
- 《高等院校旅游专业系列教材 旅游企业岗位培训系列教材 新编北京导游英语》杨昆,鄢莉,谭明华 2019
- 《电子应用技术项目教程 第3版》王彰云 2019
- 《中国十大出版家》王震,贺越明著 1991
- 《近代民营出版机构的英语函授教育 以“商务、中华、开明”函授学校为个案 1915年-1946年版》丁伟 2017