* Capturing a wealth of experience about the design of object-oriented software, four top-notch designers present a catalog of simple and succinct solutions to commonly occurring design problems. Previously undocumented, these 23 patterns allow designers to create more flexible, elegant, and ultimately reusable designs without having to rediscover the design solutions themselves. * The authors begin by describing what patterns are and how they can help you design object-oriented software. They then go on to systematically name, explain, evaluate, and catalog recurring designs in object-oriented systems. With Design Patterns as your guide, you will learn how these important patterns fit into the software development process, and how you can leverage them to solve your own design problems most efficiently. Contents......Page 2 Preface to CD......Page 5 Preface to Book......Page 7 Foreword......Page 9 Guide to Readers......Page 10 1. Introduction......Page 11 What is a Design Pattern?......Page 12 Design Patterns in Smalltalk MVC......Page 14 Describing Design Patterns......Page 16 The Catalog of Design Patterns......Page 18 Organizing the Catalog......Page 21 Finding Appropriate Objects......Page 24 Specifying Object Interfaces......Page 25 Specifying Object Implementations......Page 26 Putting Reuse Mechanisms to Work......Page 31 Designing for Change......Page 36 How to Select a Design Pattern......Page 42 How to Use a Design Pattern......Page 43 2. A Case Study: Design a Document Editor......Page 46 Document Structure......Page 47 Recursive Composition......Page 49 Glyphs......Page 50 Formatting......Page 52 Encapsulating the Formatting Algorithm......Page 53 Compositor and Composition......Page 54 Strategy Pattern......Page 55 Transparent Enclosure......Page 56 Monoglyph......Page 57 Abstracting Object Creation......Page 60 Factories and Product Classes......Page 61 Supporting Multiple Window Systems......Page 64 Encapsulating Implementation Dependencies......Page 65 WindowImp Subclasses......Page 68 Configuring Windows with WindowImps......Page 70 Bridge Pattern......Page 71 User Operations......Page 72 Encapsulating a Request......Page 73 Command Class and Subclasses......Page 74 Undoability......Page 75 Command History......Page 76 Spelling Checking and Hyphenation......Page 77 Encapsulating Access and Traversal......Page 78 Iterator Class and Subclasses......Page 80 Traversal versus Traversal Actions......Page 83 Encapsulating the Analysis......Page 84 Visitor Class and Subclasses......Page 88 Summary......Page 90 3. Creational Patterns......Page 94 Motivation......Page 99 Applicability......Page 100 Collaborations......Page 101 Implementation......Page 102 Sample Code......Page 104 Known Uses......Page 108 Related Patterns......Page 109 Motivation......Page 110 Applicability......Page 111 Collaborations......Page 112 Consequences......Page 113 Implementation......Page 114 Sample Code......Page 115 Known Uses......Page 119 Related Patterns......Page 120 Motivation......Page 121 Structure......Page 122 Consequences......Page 123 Implementation......Page 125 Sample Code......Page 129 Related Patterns......Page 131 Motivation......Page 133 Applicability......Page 134 Consequences......Page 135 Implementation......Page 137 Sample Code......Page 139 Known Uses......Page 142 Related Patterns......Page 143 Applicability......Page 144 Consequences......Page 145 Implementation......Page 146 Sample Code......Page 150 Known Uses......Page 151 Related Patterns......Page 152 Discussion of Creational Patterns......Page 153 4. Structural Patterns......Page 155 Motivation......Page 157 Structure......Page 159 Consequences......Page 160 Implementation......Page 162 Sample Code......Page 165 Known Uses......Page 168 Related Patterns......Page 169 Motivation......Page 171 Applicability......Page 173 Participants......Page 174 Implementation......Page 175 Sample Code......Page 177 Known Uses......Page 181 Related Patterns......Page 182 Motivation......Page 183 Applicability......Page 184 Participants......Page 185 Consequences......Page 186 Implementation......Page 187 Sample Code......Page 191 Known Uses......Page 194 Related Patterns......Page 195 Motivation......Page 196 Applicability......Page 198 Collaborations......Page 199 Implementation......Page 200 Sample Code......Page 203 Known Uses......Page 205 Related Patterns......Page 207 Motivation......Page 208 Applicability......Page 209 Consequences......Page 210 Implementation......Page 211 Sample Code......Page 212 Known Uses......Page 215 Related Patterns......Page 217 Motivation......Page 218 Structure......Page 221 Participants......Page 222 Implementation......Page 223 Sample Code......Page 224 Related Patterns......Page 231 Motivation......Page 233 Structure......Page 235 Collaborations......Page 236 Implementation......Page 237 Sample Code......Page 240 Related Patterns......Page 244 Adapter versus Bridge......Page 246 Composite versus Decorator versus Proxy......Page 247 5. Behavioral Patterns......Page 249 Motivation......Page 251 Structure......Page 253 Collaborations......Page 254 Implementation......Page 255 Sample Code......Page 258 Known Uses......Page 261 Related Patterns......Page 262 Motivation......Page 263 Applicability......Page 266 Collaborations......Page 267 Implementation......Page 268 Sample Code......Page 270 Related Patterns......Page 273 Motivation......Page 274 Applicability......Page 276 Participants......Page 277 Consequences......Page 278 Sample Code......Page 279 Related Patterns......Page 287 Motivation......Page 289 Structure......Page 291 Implementation......Page 292 Sample Code......Page 295 Known Uses......Page 302 Related Patterns......Page 303 Motivation......Page 305 Structure......Page 308 Collaborations......Page 309 Implementation......Page 310 Sample Code......Page 311 Known Uses......Page 314 Related Patterns......Page 315 Motivation......Page 316 Participants......Page 318 Consequences......Page 319 Implementation......Page 320 Sample Code......Page 321 Known Uses......Page 323 Related Patterns......Page 324 Motivation......Page 326 Applicability......Page 327 Collaborations......Page 328 Consequences......Page 329 Implementation......Page 330 Sample Code......Page 334 Related Patterns......Page 337 Motivation......Page 338 Participants......Page 339 Consequences......Page 340 Implementation......Page 341 Sample Code......Page 343 Known Uses......Page 346 Related Patterns......Page 347 Motivation......Page 349 Applicability......Page 350 Consequences......Page 351 Implementation......Page 353 Sample Code......Page 354 Known Uses......Page 358 Related Patterns......Page 359 Motivation......Page 360 Applicability......Page 361 Consequences......Page 362 Sample Code......Page 364 Related Patterns......Page 365 Motivation......Page 366 Structure......Page 368 Participants......Page 369 Consequences......Page 370 Implementation......Page 372 Sample Code......Page 375 Related Patterns......Page 380 Objects as Arguments......Page 382 Should Communication be Encapsulated or Distributed?......Page 383 Decoupling Senders and Receivers......Page 384 Summary......Page 386 A Common Design Vocabulary......Page 388 An Adjunct to Existing Methods......Page 389 A Target for Refactoring......Page 390 A Brief History......Page 392 Alexander's Pattern Languages......Page 393 Patterns in Software......Page 394 An Invitation......Page 395 A Parting Thought......Page 396 Appendix A: Glossary......Page 397 Class Diagram......Page 404 Object Diagram......Page 406 Interaction Diagram......Page 407 List......Page 409 Iterator......Page 412 Point......Page 413 Rect......Page 414 Bibliography......Page 416 Capturing a wealth of experience about the design of object-oriented software, four top-notch designers present a catalog of simple and succinct solutions to commonly occurring design problems. Previously undocumented, these 23 patterns allow designers to create more flexible, elegant, and ultimately reusable designs without having to rediscover the design solutions themselves.
The authors begin by describing what patterns are and how they can help you design object-oriented software. They then go on to systematically name, explain, evaluate, and catalog recurring designs in object-oriented systems. With Design Patterns as your guide, you will learn how these important patterns fit into the software development process, and how you can leverage them to solve your own design problems most efficiently.
Each pattern describes the circumstances in which it is applicable, when it can be applied in view of other design constraints, and the consequences and trade-offs of using the pattern within a larger design. All patterns are compiled from real systems and are based on real-world examples. Each pattern also includes code that demonstrates how it may be implemented in object-oriented programming languages like C++ or Smalltalk.
If you're looking for a book which will introduce you to object-oriented design (OOD), look elsewhere: this beautifully-written book is something quite different, a book of design patterns which prescribe simple solutions to the problems programmers face in object-oriented software design. This book will change the way you think about OOD with its clear text and examples so elegant that you'll kick yourself for not thinking of them yourself. With these insightful examples to learn from, you'll be able to make your own software more reusable, portable and understandable by learning how to use patterns to solve specific design problems. The authors liken Design Patterns to an architect's pattern book, filled with designs which have stood the test of time in decades of OO programming along with explanations of where each pattern could and should be used and the pros and cons of using the particular pattern in a larger design. Patterns include code for implementation in object-oriented languages like C++ and Smalltalk. This is the OO programmer's Bible, don't miss it.
Preface Foreword Guide to Readers 1 Introduction What Is a Design Pattern? Design Patterns in Smalltalk MVC Describing Design Patterns The Catalog of Design Patterns Organizing the Catalog How Design Patterns Solve Design Problems How to Select a Design Pattern How to Use a Design Pattern 2 A Case Study: Designing a Document Editor Design Problems Document Structure Formatting Embellishing the User Interface Supporting Multiple Look-and-Feel Standards Supporting Multiple Window Systems User Operations Spelling Checking and Hyphenation Summary Design Pattern Catalog 3 Creational Patterns Abstract Factory Builder Factory Method Prototype Singleton Discussion of Creational Patterns 4 Structural Pattern Adapter Bridge Composite Decorator Facade Flyweight Proxy Discussion of Structural Patterns 5 Behavioral Patterns Chain of Responsibility Command Interpreter Iterator Mediator Memento Observer State Strategy Template Method Visitor Discussion of Behavioral Patterns 6 Conclusion What to Expect from Design Patterns A Brief History The Pattern Community An Invitation A Parting Thought Appendix A Glossary Appendix B Guide to Notation Class Diagram Object Diagram Interaction Diagram Appendix C Foundation Classes List Iterator ListIterator Point Rect Bibliography Index The Gang of Four's seminal catalog of 23 patterns to solve commonly occurring design problems Patterns allow designers to create more flexible, elegant, and ultimately reusable designs without having to rediscover the design solutions themselves. Highly influential, Design Patterns is a modern classic that introduces what patterns are and how they can help you design object-oriented software and provides a catalog of simple solutions for those already programming in at last one object-oriented programming language. Each pattern: Describes the circumstances in which it is applicable, when it can be applied in view of other design constraints, and the consequences and trade-offs of using the pattern within a larger design Is compiled from real systems and based on real-world examples Includes downloadable C++ source code that demonstrates how patterns can be implemented and Python From the preface: “Once you the design patterns and have had an ‘Aha!'(and not just a ‘Huh?') experience with them, you won't ever think about object-oriented design in the same way. You'll have insights that can make your own designs more flexible, modular, reusable, and understandable - which is why you're interested in object-oriented technology in the first place, right?” Four software designers present a catalog of simple and succinct solutions to commonly occurring design problems, using Smalltalk and C++ in example code. These 23 patterns allow designers to create more flexible, elegant, and ultimately reusable designs without having to rediscover the design solutions themselves. The authors begin by describing what patterns are and how they can help you design object-oriented software. They go on to systematically name, explain, evaluate, and catalog recurring designs in object-oriented systems.--From publisher description. "Four software designers present a catalog of simple and succinct solutions to commonly occurring design problems, using Smalltalk and C++ in example code. These 23 patterns allow designers to create more flexible, elegant, and ultimately reusable designs without having to rediscover the design solutions themselves. The authors begin by describing what patterns are and how they can help you design object-oriented software. They go on to systematically name, explain, evaluate, and catalog recurring designs in object-oriented systems. --" Résumé de l'éditeur Four top-notch authors present the first book containing a catalog of object-oriented design patterns. Readers will learn how to use design patterns in the object-oriented development process, how to solve specific design problems using patterns, and gain a common vocabulary for object-oriented design. Four top-notch authors present the first book containing a catalog of object-oriented design patterns. Readers can learn how to use design patterns in the object-oriented development process, solve specific design problems using patterns, and gain a common vocabulary for object-oriented design. Preface Foreward Guide to Readers Introduction What is a Design Pattern Design Patterns in Smalltalk MVC Describing Design Patterns The Catalog of Design Patterns Organizing the Catalog How Design Patterns Solve Design