Design Patterns Explained: A New Perspective on Object-Oriented Design
by Alan Shalloway, James R. Trott
From Book News, Inc.
This guide for software developers describes the basic principles underlying object-oriented programming and design patterns. The volume begins with introductory material on object-oriented software development and the limitations of traditional object-oriented design. The rest of the text is devoted to an exploration of ten commonly-used design patterns, such as the facade, adapter, bridge, observer, double-checked locking, and factory method patterns.Book News, Inc.®, Portland, OR
Addison-Wesley Pub Co
Design patterns books have been gaining popularity since languages like Java and C++ first became widely used. Since Microsoft released its first truly object-oriented language, .NET, software designers from an even broader range of business and programming spheres have been looking for ways to refine and write better code. Many have turned toward design patterns, iterative and AGILE design methodologies, and other more defined ways to improve performance, maintainability, portability, and scalability of code as well as design processes. This book fits into that need in that it can teach people who write software new skills and techniques for improving their existing and new coding efforts.
- Paperback: 300 pages
- Publisher: Wordware Publishing, Inc. (September 25, 2006)
- Language: English
- ISBN: 1598220314
Addison Wesley. October 1994.
Winner: Software Development, 1994 Productivity Award .
From the Preface:
... a book of design patterns that describes simple and elegant solutions to specific problems in object-oriented software design. Design patterns capture solutions that have developed and evolved over time. Hence they aren't the designs people tend to generate initially. They reflect untold redesign and recoding as developers have struggled for greater reuse and flexibility in their software. Design patterns capture these solutions in a succinct and easily applied form.
Design Patterns is part of the Addison Wesley Professional Computing Series, a series that encompasses the state of the art in programming languages, operating systems, and network technology. Published October 1994, 416 pages, hardback, ISBN 0-201-63361-2.
- Table of Contents
- Foreword by Grady Booch
- Papers and References cited in the book that are available online.
- Obtaining the Source Code
- Reviews of Design Patterns.
- HTML Template if you want to write your own patterns.
This book isn't an introduction to object-oriented technology or design. Many books already do a good job of that. This book assumes you are reasonably proficient in at least one object-oriented programming language, and you should have some experience in object-oriented design as well. You definitely shouldn't have to rush to the nearest dictionary the moment we mention ``types'' and ``polymorphism,'' or ``interface'' as opposed to ``implementation'' inheritance.
On the other hand, this isn't an advanced technical treatise either. It's a book of design patterns that describes simple and elegant solutions to specific problems in object-oriented software design. Design patterns capture solutions that have developed and evolved over time. Hence they aren't the designs people tend to generate initially. They reflect untold redesign and recoding as developers have struggled for greater reuse and flexibility in their software. Design patterns capture these solutions in a succinct and easily applied form.
The design patterns require neither unusual language features nor amazing programming tricks with which to astound your friends and managers. All can be implemented in standard object-oriented languages, though they might take a little more work than ad hoc solutions. But the extra effort invariably pays dividends in increased flexibility and reusability.
Once you understand 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?
A word of warning and encouragement: Don't worry if you don't understand this book completely on the first reading. We didn't understand it all on the first writing! Remember that this isn't a book to read once and put on a shelf. We hope you'll find yourself referring to it again and again for design insights and for inspiration.
Guide to Readers
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 Che cking 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
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
All well-structured object-oriented architectures are full of patterns. Indeed, one of the ways that I measure the quality of an object-oriented system is to judge whether or not its developers have paid careful attention to the common collaborations among its objects. Focusing on such mechanisms during a system's development can yield an architecture that is smaller, simpler, and far more understandable than if these patterns are ignored.
The importance of patterns in crafting complex systems has been long recognized in other disciplines. In particular, Christopher Alexander and his colleagues were perhaps the first to propose the idea of using a pattern language to architect buildings and cities. His ideas and the contributions of others have now taken root in the object-oriented software community. In short, the concept of the design pattern in software provides a key to helping developers leverage the expertise of other skilled architects.
In this book, Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides introduce the principles of design patterns and then offer a catalog of such patterns. Thus, this book makes two important contributions. First, it shows the role that patterns can play in architecting complex systems. Second, it provides a very pragmatic reference to a set of well-engineered patterns that the practicing developer can apply to crafting his or her own specific applications.
I'm honored to have had the opportunity to work directly with some of the authors of this book in architectural design efforts. I have learned much from them, and I suspect that in reading this book, you will also.
Grady Booch, Chief Scientist, Rational Software Corporation
All the C++ source code for the patterns in the book is available in the following formats.
- Compressed tar file: ftp
- Unpack with uncompress, then tar -xf.
- Zipped files: ftp
- Unpack with unzip
Note, this code is stripped directly from the original text and although it all compiles, (well almost all). Our goal was to have syntactically correct code, but not complete or executable code. We have played some tricks with #ifdefs, and introduced some dummy functions, so as to compile the pattern. These do not appear in the book.
What others have said about Design Patterns.
- Lots of reviews at Amazon Books, plus you can order a copy at 40% off!
by Karen Gardner, Alex Rush, Bob Konitzer, Mike Crist and Bobbin Teegarden
Publisher is Cambridge University Press (1998), ISBN 0-521-64998-6.