《深入浅出设计模式》的编写方式采用引导式教学,不直接告诉你该怎么做,而是利用故事当作引子,带领读者思考并想办法解决问题。解决问题的过程中又会产生一些新的问题,再继续思考、继续解决问题,这样可以加深体会。作者以大量的生活化故事当背景,例如章是鸭子,第2章是气象站,第3章是咖啡店,书中搭配了大量的插图,所以阅读起来生动有趣。作者还利用歪歪斜斜的手写字体,增加“现场感”。精心设计许多爆笑的对白,让学习过程不会太枯燥。
Intro
1 Welcome to Design Patterns: an introduction
2 Keeping your Objects in the know: the Observer Pattern
3 Decorating Objects: the Decorator Pattern
4 Baking with OO goodness: the Factory Pattern
5 One of a Kind Objects: the Singleton Pattern
6 Encapsulating Invocation: the Command Pattern
7 Being Adaptive: the Adapter and Facade Patterns
8 Encapsulating Algorithms: the Template Method Pattern
9 Well-managed Collections: the Iterator and Composite Patterns
10 The State of Things: the State Pattern
11 Controlling Object Access: the Proxy Pattern
12 Patterns of Patterns: Compound Patterns
13 Patterns in the Real World: Better Living with Patterns
14 Appendix: LeftoverPatterns