| | |
Summary: Design Patterns by Example
Garrett Mitchener
July 21, 1997
Contents
1 Introduction 1
1.1 Our job as programmers . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Tools of object oriented programming . . . . . . . . . . . . . . . 2
1.2.1 Encapsulation . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 Intelligent data . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.3 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Design patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Design notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 The example 6
2.1 The original assignment . . . . . . . . . . . . . . . . . . . . . . . 6
3 Before 8
3.1 Rules of the game . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Before . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1 Data structures . . . . . . . . . . . . . . . . . . . . . . . . 9
4 After 20
4.1 A more elaborate design . . . . . . . . . . . . . . . . . . . . . . . 20
|