App 下载
注册
登录
|
搜索
正在搜索中...
首页
我的书架
我的主页
我的收藏
我的书评
重构,一言以蔽之,就是在不改变外部行为的前提下,有条不紊地改善代码。多年前,正是本书原版的出版,使重构终于从编程高手们的小圈子走出,成为众多普通程序员日常开发工作中不可或
……
[ 展开全部 ]
缺的一部分。本书也因此成为与《设计模式》齐名的经典著作,被译为中、德、俄、日等众多语言,在世界范围内畅销不衰。 本书凝聚了软件开发社区专家多年摸索而获得的宝贵经验,拥有不因时光流逝而磨灭的价值。今天,无论是重构本身,业界对重构的理解,还是开发工具对重构的支持力度,都与本书最初出版时不可同日而语,但书中所蕴涵的意味和精华,依然值得反复咀嚼,而且往往能够常读常新。
[ 收起 ]
作者:Martin Fowler
出版社:人民邮电出版社
定价:69.00元
ISBN:7115239142
给个评价
做个书摘
书摘 (21 )
评价 (1 )
查看所有书摘
按目录显示书摘
只显示目录
Chapter 1 Refactoring, a First Example 1
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
The Starting Point 1
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
The First Step in Refactoring 7
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Decomposing and Redistributing the Statement Metho
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replacing the Conditional Logic on Price Code with
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Final Thoughts 52
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 2: Principles in Refactoring 53
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Defining Refactoring 53
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Why Should You Refactor 55
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
When Should You Refactor 57
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
What Do I Tell My Manager 60
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Problems with Refactoring 62
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Refactoring and Design 66
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Refactoring and Performance 69
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Where Did Refactoring Come From 71
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 3: Bad Smells in Code (by Kent Beck and Ma
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Duplicated Code 76
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Long Method 76
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Large Class 78
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Long Parameter List 78
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Divergent Change 79
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Shotgun Surgery 80
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Feature Envy 80
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Data Clumps 81
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Primitive Obsession 81
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Switch Statements 82
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Parallel Inheritance Hierarchies 83
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Lazy Class 83
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Speculative Generality 83
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Temporary Field 84
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Message Chains 84
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Middle Man 85
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Inappropriate Intimacy 85
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Alternative Classes with Different Interfaces 85
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Incomplete Library Class86
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Data Class 86
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Refused Bequest 87
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Comments 87
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 4: Building Tests 89
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
The Value of Self-testing Code 89
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
The JUnit Testing Framework 91
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Adding More Tests 97
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 5: Toward a Catalog of Refactorings
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Format of the Refactorings~103
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Finding References 105
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
How Mature Are These Refactorings 106
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 6: Composing Methods 109
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Extract Method 110
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Inline Method 117
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Inline Temp 119
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Temp with Query 120
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Introduce Explaining Variable 124
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Split Temporary Variable 128
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Remove Assignments to Parameters 131
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Method with Method Object 135
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Substitute Algorithm 139
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 7: Moving Features Between Objects 141
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Move Method 142
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Move Field 146
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Extract Class 149
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Inline Class 154
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Hide Delegate 157
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Remove Middle Man 160
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Introduce Foreign Method 162
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Introduce Local Extension 164
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 8: Organizing Data 169
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Self Encapsulate Field 171
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Data Value with Object 175
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Change Value to Reference 179
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Change Reference to Value 183
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Array with Object 186
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Duplicate Observed Data 189
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Change Unidirectional Association to Bidirectional
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Change Bidirectional Association to Unidirectional
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Magic Number with Symbolic Constant 204
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Encapsulate Field 206
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Encapsulate Collection 208
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Record with Data Class 217
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Type Code with Class 218
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Type Code with Subclasses 223
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Type Code with State/Strategy 227
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Subclass with Fields 232
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 9: Simplifying Conditional Expressions
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Decompose Conditional 238
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Consolidate Conditional Expression 240
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Consolidate Duplicate Conditional Fragments 243
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Remove Control Flag 245
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Nested Conditional with Guard Clauses 25
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Conditional with Polymorphism 255
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Introduce Null Object 260
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Introduce Assertion 267
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 10: Making Method Calls Simpler 271
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Rename Method 273
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Add Parameter 275
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Remove Parameter 277
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Separate Query from Modifier 279
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Parameterize Method 283
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Parameter with Explicit Methods 285
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Preserve Whole Object 288
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Parameter with Method 292
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Introduce Parameter Object 295
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Remove Setting Method 300
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Hide Method 303
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Constructor with Factory Method 304
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Encapsulate Downcast 308
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Error Code with Exception 310
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Exception with Test 315
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 11: Dealing with Generalization319
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Pull Up Field 320
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Pull Up Method 322
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Pull Up Constructor Body 325
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Push Down Method 328
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Push Down Field 329
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Extract Subclass 330
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Extract Superclass 336
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Extract Interface 341
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Collapse Hierarchy 344
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Form Template Method 345
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Inheritance with Delegation 352
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Replace Delegation with Inheritance 355
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 12: Big Refactorings (by Kent Beck and Mar
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Tease Apart Inheritance 362
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Convert Procedural Design to Objects 368
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Separate Domain from Presentation 370
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Extract Hierarchy 375
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 13: Refactoring, Reuse, and Reality (by Wi
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
A Reality Check 380
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Why Are Developers Reluctant to Refactor
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Their Programs 381
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
A Reality Check (Revisited) 394
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Resources and References for Refactoring 394
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Implications Regarding Software Reuse and Technolo
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
A Final Note397
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
References 397
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 14: Refactoring Tools (by Don Roberts and
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Refactoring with a Tool 401
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Technical Criteria for a Refactoring Tool 403
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Practical Criteria for a Refactoring Tool 405
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Wrap Up 407
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Chapter 15: Putting It All Together (by Kent Beck)
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
References 413
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
List of Soundbites 417
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
Index 419
还没有人在此章节添加过书摘,赶紧来抢第一吧!
在此章节添加书摘
导购链接
×
做书摘
文字书摘
读图识字
至少还需要输入
10
字
保存原图片为书摘
上传图片
识别
最多输入
500
个字
上传图片
重新上传
写点笔记吧
至少还需要输入
10
字
章节(选填)
Chapter 1 Refactoring, a First Example 1
The Starting Point 1
The First Step in Refactoring 7
Decomposing and Redistributing the Statement Metho
Replacing the Conditional Logic on Price Code with
Final Thoughts 52
Chapter 2: Principles in Refactoring 53
Defining Refactoring 53
Why Should You Refactor 55
When Should You Refactor 57
What Do I Tell My Manager 60
Problems with Refactoring 62
Refactoring and Design 66
Refactoring and Performance 69
Where Did Refactoring Come From 71
Chapter 3: Bad Smells in Code (by Kent Beck and Ma
Duplicated Code 76
Long Method 76
Large Class 78
Long Parameter List 78
Divergent Change 79
Shotgun Surgery 80
Feature Envy 80
Data Clumps 81
Primitive Obsession 81
Switch Statements 82
Parallel Inheritance Hierarchies 83
Lazy Class 83
Speculative Generality 83
Temporary Field 84
Message Chains 84
Middle Man 85
Inappropriate Intimacy 85
Alternative Classes with Different Interfaces 85
Incomplete Library Class86
Data Class 86
Refused Bequest 87
Comments 87
Chapter 4: Building Tests 89
The Value of Self-testing Code 89
The JUnit Testing Framework 91
Adding More Tests 97
Chapter 5: Toward a Catalog of Refactorings
Format of the Refactorings~103
Finding References 105
How Mature Are These Refactorings 106
Chapter 6: Composing Methods 109
Extract Method 110
Inline Method 117
Inline Temp 119
Replace Temp with Query 120
Introduce Explaining Variable 124
Split Temporary Variable 128
Remove Assignments to Parameters 131
Replace Method with Method Object 135
Substitute Algorithm 139
Chapter 7: Moving Features Between Objects 141
Move Method 142
Move Field 146
Extract Class 149
Inline Class 154
Hide Delegate 157
Remove Middle Man 160
Introduce Foreign Method 162
Introduce Local Extension 164
Chapter 8: Organizing Data 169
Self Encapsulate Field 171
Replace Data Value with Object 175
Change Value to Reference 179
Change Reference to Value 183
Replace Array with Object 186
Duplicate Observed Data 189
Change Unidirectional Association to Bidirectional
Change Bidirectional Association to Unidirectional
Replace Magic Number with Symbolic Constant 204
Encapsulate Field 206
Encapsulate Collection 208
Replace Record with Data Class 217
Replace Type Code with Class 218
Replace Type Code with Subclasses 223
Replace Type Code with State/Strategy 227
Replace Subclass with Fields 232
Chapter 9: Simplifying Conditional Expressions
Decompose Conditional 238
Consolidate Conditional Expression 240
Consolidate Duplicate Conditional Fragments 243
Remove Control Flag 245
Replace Nested Conditional with Guard Clauses 25
Replace Conditional with Polymorphism 255
Introduce Null Object 260
Introduce Assertion 267
Chapter 10: Making Method Calls Simpler 271
Rename Method 273
Add Parameter 275
Remove Parameter 277
Separate Query from Modifier 279
Parameterize Method 283
Replace Parameter with Explicit Methods 285
Preserve Whole Object 288
Replace Parameter with Method 292
Introduce Parameter Object 295
Remove Setting Method 300
Hide Method 303
Replace Constructor with Factory Method 304
Encapsulate Downcast 308
Replace Error Code with Exception 310
Replace Exception with Test 315
Chapter 11: Dealing with Generalization319
Pull Up Field 320
Pull Up Method 322
Pull Up Constructor Body 325
Push Down Method 328
Push Down Field 329
Extract Subclass 330
Extract Superclass 336
Extract Interface 341
Collapse Hierarchy 344
Form Template Method 345
Replace Inheritance with Delegation 352
Replace Delegation with Inheritance 355
Chapter 12: Big Refactorings (by Kent Beck and Mar
Tease Apart Inheritance 362
Convert Procedural Design to Objects 368
Separate Domain from Presentation 370
Extract Hierarchy 375
Chapter 13: Refactoring, Reuse, and Reality (by Wi
A Reality Check 380
Why Are Developers Reluctant to Refactor
Their Programs 381
A Reality Check (Revisited) 394
Resources and References for Refactoring 394
Implications Regarding Software Reuse and Technolo
A Final Note397
References 397
Chapter 14: Refactoring Tools (by Don Roberts and
Refactoring with a Tool 401
Technical Criteria for a Refactoring Tool 403
Practical Criteria for a Refactoring Tool 405
Wrap Up 407
Chapter 15: Putting It All Together (by Kent Beck)
References 413
List of Soundbites 417
Index 419
页码(选填)
这本书已经添加了这些章节,请勾选或者新建你的书摘所属的章节
add
up
down
remove
Chapter 1 Refactoring, a First Example 1
The Starting Point 1
The First Step in Refactoring 7
Decomposing and Redistributing the Statement Metho
Replacing the Conditional Logic on Price Code with
Final Thoughts 52
Chapter 2: Principles in Refactoring 53
Defining Refactoring 53
Why Should You Refactor 55
When Should You Refactor 57
What Do I Tell My Manager 60
Problems with Refactoring 62
Refactoring and Design 66
Refactoring and Performance 69
Where Did Refactoring Come From 71
Chapter 3: Bad Smells in Code (by Kent Beck and Ma
Duplicated Code 76
Long Method 76
Large Class 78
Long Parameter List 78
Divergent Change 79
Shotgun Surgery 80
Feature Envy 80
Data Clumps 81
Primitive Obsession 81
Switch Statements 82
Parallel Inheritance Hierarchies 83
Lazy Class 83
Speculative Generality 83
Temporary Field 84
Message Chains 84
Middle Man 85
Inappropriate Intimacy 85
Alternative Classes with Different Interfaces 85
Incomplete Library Class86
Data Class 86
Refused Bequest 87
Comments 87
Chapter 4: Building Tests 89
The Value of Self-testing Code 89
The JUnit Testing Framework 91
Adding More Tests 97
Chapter 5: Toward a Catalog of Refactorings
Format of the Refactorings~103
Finding References 105
How Mature Are These Refactorings 106
Chapter 6: Composing Methods 109
Extract Method 110
Inline Method 117
Inline Temp 119
Replace Temp with Query 120
Introduce Explaining Variable 124
Split Temporary Variable 128
Remove Assignments to Parameters 131
Replace Method with Method Object 135
Substitute Algorithm 139
Chapter 7: Moving Features Between Objects 141
Move Method 142
Move Field 146
Extract Class 149
Inline Class 154
Hide Delegate 157
Remove Middle Man 160
Introduce Foreign Method 162
Introduce Local Extension 164
Chapter 8: Organizing Data 169
Self Encapsulate Field 171
Replace Data Value with Object 175
Change Value to Reference 179
Change Reference to Value 183
Replace Array with Object 186
Duplicate Observed Data 189
Change Unidirectional Association to Bidirectional
Change Bidirectional Association to Unidirectional
Replace Magic Number with Symbolic Constant 204
Encapsulate Field 206
Encapsulate Collection 208
Replace Record with Data Class 217
Replace Type Code with Class 218
Replace Type Code with Subclasses 223
Replace Type Code with State/Strategy 227
Replace Subclass with Fields 232
Chapter 9: Simplifying Conditional Expressions
Decompose Conditional 238
Consolidate Conditional Expression 240
Consolidate Duplicate Conditional Fragments 243
Remove Control Flag 245
Replace Nested Conditional with Guard Clauses 25
Replace Conditional with Polymorphism 255
Introduce Null Object 260
Introduce Assertion 267
Chapter 10: Making Method Calls Simpler 271
Rename Method 273
Add Parameter 275
Remove Parameter 277
Separate Query from Modifier 279
Parameterize Method 283
Replace Parameter with Explicit Methods 285
Preserve Whole Object 288
Replace Parameter with Method 292
Introduce Parameter Object 295
Remove Setting Method 300
Hide Method 303
Replace Constructor with Factory Method 304
Encapsulate Downcast 308
Replace Error Code with Exception 310
Replace Exception with Test 315
Chapter 11: Dealing with Generalization319
Pull Up Field 320
Pull Up Method 322
Pull Up Constructor Body 325
Push Down Method 328
Push Down Field 329
Extract Subclass 330
Extract Superclass 336
Extract Interface 341
Collapse Hierarchy 344
Form Template Method 345
Replace Inheritance with Delegation 352
Replace Delegation with Inheritance 355
Chapter 12: Big Refactorings (by Kent Beck and Mar
Tease Apart Inheritance 362
Convert Procedural Design to Objects 368
Separate Domain from Presentation 370
Extract Hierarchy 375
Chapter 13: Refactoring, Reuse, and Reality (by Wi
A Reality Check 380
Why Are Developers Reluctant to Refactor
Their Programs 381
A Reality Check (Revisited) 394
Resources and References for Refactoring 394
Implications Regarding Software Reuse and Technolo
A Final Note397
References 397
Chapter 14: Refactoring Tools (by Don Roberts and
Refactoring with a Tool 401
Technical Criteria for a Refactoring Tool 403
Practical Criteria for a Refactoring Tool 405
Wrap Up 407
Chapter 15: Putting It All Together (by Kent Beck)
References 413
List of Soundbites 417
Index 419
×
添加一个书摘本
搜索创建书摘本
搜索
正在搜索...
不对,换一下
书名
作者
出版社
备注
ISBN
*
*
Chapter 1 Refactoring, a First Example 1
The Starting Point 1
The First Step in Refactoring 7
Decomposing and Redistributing the Statement Metho
Replacing the Conditional Logic on Price Code with
Final Thoughts 52
Chapter 2: Principles in Refactoring 53
Defining Refactoring 53
Why Should You Refactor 55
When Should You Refactor 57
What Do I Tell My Manager 60
Problems with Refactoring 62
Refactoring and Design 66
Refactoring and Performance 69
Where Did Refactoring Come From 71
Chapter 3: Bad Smells in Code (by Kent Beck and Ma
Duplicated Code 76
Long Method 76
Large Class 78
Long Parameter List 78
Divergent Change 79
Shotgun Surgery 80
Feature Envy 80
Data Clumps 81
Primitive Obsession 81
Switch Statements 82
Parallel Inheritance Hierarchies 83
Lazy Class 83
Speculative Generality 83
Temporary Field 84
Message Chains 84
Middle Man 85
Inappropriate Intimacy 85
Alternative Classes with Different Interfaces 85
Incomplete Library Class86
Data Class 86
Refused Bequest 87
Comments 87
Chapter 4: Building Tests 89
The Value of Self-testing Code 89
The JUnit Testing Framework 91
Adding More Tests 97
Chapter 5: Toward a Catalog of Refactorings
Format of the Refactorings~103
Finding References 105
How Mature Are These Refactorings 106
Chapter 6: Composing Methods 109
Extract Method 110
Inline Method 117
Inline Temp 119
Replace Temp with Query 120
Introduce Explaining Variable 124
Split Temporary Variable 128
Remove Assignments to Parameters 131
Replace Method with Method Object 135
Substitute Algorithm 139
Chapter 7: Moving Features Between Objects 141
Move Method 142
Move Field 146
Extract Class 149
Inline Class 154
Hide Delegate 157
Remove Middle Man 160
Introduce Foreign Method 162
Introduce Local Extension 164
Chapter 8: Organizing Data 169
Self Encapsulate Field 171
Replace Data Value with Object 175
Change Value to Reference 179
Change Reference to Value 183
Replace Array with Object 186
Duplicate Observed Data 189
Change Unidirectional Association to Bidirectional
Change Bidirectional Association to Unidirectional
Replace Magic Number with Symbolic Constant 204
Encapsulate Field 206
Encapsulate Collection 208
Replace Record with Data Class 217
Replace Type Code with Class 218
Replace Type Code with Subclasses 223
Replace Type Code with State/Strategy 227
Replace Subclass with Fields 232
Chapter 9: Simplifying Conditional Expressions
Decompose Conditional 238
Consolidate Conditional Expression 240
Consolidate Duplicate Conditional Fragments 243
Remove Control Flag 245
Replace Nested Conditional with Guard Clauses 25
Replace Conditional with Polymorphism 255
Introduce Null Object 260
Introduce Assertion 267
Chapter 10: Making Method Calls Simpler 271
Rename Method 273
Add Parameter 275
Remove Parameter 277
Separate Query from Modifier 279
Parameterize Method 283
Replace Parameter with Explicit Methods 285
Preserve Whole Object 288
Replace Parameter with Method 292
Introduce Parameter Object 295
Remove Setting Method 300
Hide Method 303
Replace Constructor with Factory Method 304
Encapsulate Downcast 308
Replace Error Code with Exception 310
Replace Exception with Test 315
Chapter 11: Dealing with Generalization319
Pull Up Field 320
Pull Up Method 322
Pull Up Constructor Body 325
Push Down Method 328
Push Down Field 329
Extract Subclass 330
Extract Superclass 336
Extract Interface 341
Collapse Hierarchy 344
Form Template Method 345
Replace Inheritance with Delegation 352
Replace Delegation with Inheritance 355
Chapter 12: Big Refactorings (by Kent Beck and Mar
Tease Apart Inheritance 362
Convert Procedural Design to Objects 368
Separate Domain from Presentation 370
Extract Hierarchy 375
Chapter 13: Refactoring, Reuse, and Reality (by Wi
A Reality Check 380
Why Are Developers Reluctant to Refactor
Their Programs 381
A Reality Check (Revisited) 394
Resources and References for Refactoring 394
Implications Regarding Software Reuse and Technolo
A Final Note397
References 397
Chapter 14: Refactoring Tools (by Don Roberts and
Refactoring with a Tool 401
Technical Criteria for a Refactoring Tool 403
Practical Criteria for a Refactoring Tool 405
Wrap Up 407
Chapter 15: Putting It All Together (by Kent Beck)
References 413
List of Soundbites 417
Index 419