1 / 186
文档名称:

Thinking in Patterns with Java.pdf

格式:pdf   页数:186
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

Thinking in Patterns with Java.pdf

上传人:bolee65 2014/4/14 文件大小:0 KB

下载得到文件列表

Thinking in Patterns with Java.pdf

文档介绍

文档介绍:Thinking
in
Patterns
with Java
Bruce Eckel
President, MindView, Inc.

Revision
Please note that this document is in its initial form, and much remains to
be done. Corrections ments should go to
ts/TIPatterns/
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 challenge16
Exercises............................ 17
2: Unit Testing 19
Write tests first..................20
A very simple framework .. 21
Writing tests ......................23
White-box & black-box tests25
Running tests.....................28
Automatically executing tests30
Exercises............................30
3: Building application frameworks 31
Template method .............. 31
4:Fronting for an implementation 33
Proxy..................................34
State ...................................35
StateMachine.....................38
Tools ..................................44
Exercises............................45
X: Iterators: decoupling algorithms from containers 47
Type-safe iterators ............48
5: Factories: encapsulating object creation 51
Simple Factory method.....52
Polymorphic factories .......54
Abstract factories .............. 57
Exercises............................60
6: Function objects 61
Command .......................... 61
Strategy..............................63
Chain of responsibility ......65
Exercises ............................67
7: Changing the interface 69
Adapter ..............................69
Façade................................ 71
Package as a variation of Façade .72
Exercises ............................73
8: Table-driven code: configuration flexibility 75
Table-driven code using anonymous inner classes 75
9: Interpreter/ Multiple Languages