实现模式(英文版)

分類: 图书,计算机/网络,程序设计,其他,
作者: (美)Kent Beck 著
出 版 社: 人民邮电出版社
出版时间: 2008-11-1字数: 219000版次: 1页数: 157印刷时间: 2008/11/01开本: 16开印次: 1纸张: 胶版纸I S B N : 9787115187093包装: 平装内容简介
在本书中,作者将自己多年形成的编程习惯以及阅读既有代码的体验凝练成了编程中的价值观、原则和77种实现模式。
沟通、简单和灵活的价值观应当被所有开发人员所铭记。局部影响、最小化重复、将逻辑与数据捆绑等原则同样是通用性的指导思想,比价值观更贴近编程场景,在价值观和模式之间搭建了桥梁。在77个实现模式中,每一个模式都覆盖了编写简洁、清晰、易扩展、易维护的代码这一原则的某个方面。它们为日常的编程提供了丰富翔实的参考依据,并告诉大家这些代码如何为降低沟通成本和提高有效产出提供保障。
本书适用于各个阶段的开发者群体,刚刚涉足软件开发领域的新人能够透过大师的眼睛来看待编程,了解编程的价值观与原则;而具有丰富经验的资深工程师则可以通过这些模式进行反思,探究成功实践背后的意义。把价值观、原则和开发实践结合之后,日常开发工作便会以崭新迷人的形式呈现在我们面前。
目录
Chapter 1: Introduction1
Tour Guide3
And Now4
Chapter 2: Patterns5
Chapter 3: A Theory of Programming9
Values10
Communication10
Simplicity11
Flexibility12
Principles13
Local Consequences13
Minimize Repetition14
Logic and Data Together14
Symmetry15
Declarative Expression16
Rate of Change17
Conclusion18
Chapter 4: Motivation19
Chapter 5: Class21
Class22
Simple Superclass Name23
Qualified Subclass Name24
Abstract Interface24
Interface26
Abstract Class26
Versioned Interface27
Value Object28
Specialization31
Subclass32
Implementor34
Inner Class34
Instance-Specific Behavior36
Conditional36
Delegation38
Pluggable Selector40
Anonymous Inner Class41
Library Class41
Conclusion42
Chapter 6: State43
State44
Access45
Direct Access46
Indirect Access47
Common State47
Variable State48
Extrinsic State50
Variable50
Local Variable51
Field52
Parameter53
Collecting Parameter55
Optional Parameter56
Var Args56
Parameter Object57
Constant58
Role-Suggesting Name58
Declared Type60
Initialization61
Eager Initialization61
Lazy Initialization62
Conclusion62
Chapter 7: Behavior63
Control Flow64
Main Flow64
Message65
Choosing Message65
Double Dispatch66
Decomposing (Sequencing) Message67
Reversing Message67
Inviting Message68
Explaining Message69
Exceptional Flow70
Guard Clause70
Exception72
Checked Exceptions72
Exception Propagation73
Conclusion73
Chapter 8: Methods75
Composed Method77
Intention-Revealing Name79
Method Visibility80
Method Object82
Overridden Method83
Overloaded Method83
Method Return Type84
Method Comment85
Helper Method85
Debug Print Method86
Conversion87
Conversion Method87
Conversion Constructor88
Creation88
Complete Constructor89
Factory Method90
Internal Factory91
Collection Accessor Method91
Boolean Setting Method93
Query Method93
Equality Method94
Getting Method95
Setting Method96
Safe Copy97
Conclusion98
Chapter 9: Collections99
Metaphors100
Issues101
Interfaces103
Array103
Iterable104
Collection104
List104
Set105
SortedSet105
Map106
Implementations107
Collection108
List108
Set108
Map109
Collections110
Searching111
Sorting112
Unmodifiable Collections113
Single-Element Collections114
Empty Collections114
Extending Collections114
Conclusion115
Chapter 10: Evolving Frameworks117
Changing Frameworks without Changing Applications117
Incompatible Upgrades118
Encouraging Compatible Change120
Library Class121
Objects121
Conclusion129
Appendix A: Performance Measurement131
Example131
API132
Implementation133
MethodTimer134
Canceling Overhead136
Tests136
Comparing Collections137
Comparing ArrayList and LinkedList139
Comparing Sets140
Comparing Maps141
Conclusion142
Bibliography145
General Programming145
Philosophy147
Java148
Index149