没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
Contents
Preface 7
Introduction 9
1: The pattern concept 11
What is a pattern?.............. 11
Pattern taxonomy...............13
The singleton...................... 14
Classifying patterns........... 15
The development challenge17
Exercises.............................. 17
2: Unit Testing 19
Write tests first................... 20
A very simple framework. 21
Writing tests .......................23
White-box & black-box tests26
Running tests...................... 28
Automatically executing tests 30
Exercises.............................. 31
3: Building application frameworks 33
Template method............... 33
4:Fronting for an implementation 35
Proxy.................................... 36
State...................................... 37
StateMachine...................... 40
Tools..................................... 47
Exercises.............................. 47
X: Iterators: decoupling algorithms from containers 49
Type-safe iterators............. 50
5: Factories: encapsulating object creation 53
Simple Factory method..... 54
Polymorphic factories........56
Abstract factories................59
Exercises ..............................62
6: Function objects 63
Command............................63
Strategy................................65
Chain of responsibility......67
Exercises ..............................69
7: Changing the interface 71
Adapter................................71
Façade..................................73
Package as a variation of Façade.. 74
Exercises ..............................75
8: Table-driven code: configuration flexibility 77
Table-driven code using anonymous inner classes 77
9: Interpreter/ Multiple Languages 79
Interpreter............................80
Motivation...........................80
Python overview................81
Built-in containers......................... 82
Functions........................................83
Strings.............................................84
Classes.............................................85
Creating a language...........89
Configuring Jython.......................93
Generating documentation93
Controlling the interpreter94
Putting data in............................... 94
Getting data out........................... 100
Multiple interpreters...................103
Controlling Java from Jython104
Using Java libraries..........108
Inheriting from Java library classes110
Creating Java classes with Jython 111
Building the Java classes from the Python code 116
Summary...........................117
Exercises ............................118
10: Callbacks 119
Observer............................119
Observing flowers.......................121
A visual example of observers 125
Exercises............................ 128
11: Multiple dispatching 129
Visitor, a type of multiple dispatching 132
Exercises............................ 135
12: Pattern refactoring 137
Simulating the trash recycler137
Improving the design...... 141
“Make more objects”...................142
A pattern for prototyping creation 145
Trash subclasses..........................150
Parsing Trash from an external file151
Recycling with prototyping.......155
Abstracting usage............ 156
Multiple dispatching....... 161
Implementing the double dispatch162
The Visitor pattern........... 169
A Reflective Decorator................172
More coupling?............................178
RTTI considered harmful?178
Summary........................... 181
Exercises............................ 183
13: Projects 184
Rats & Mazes.................... 184
Other maze resources..................189
XML Decorator.................189
剩余188页未读,继续阅读
BombZhang
- 粉丝: 22
- 资源: 25
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0