Gamma – Helm - Johnson – Vlissides
Once you've absorbed the design patterns in this book, your design vocabulary will almost certainly change.
You will speak directly in terms of the names of the design patterns. You'll find yourself saying things like,
"Let's use an Observer here," or, "Let's make a Strategy out of these classes."
A Documentation and Learning Aid
Knowing the design patterns in this book makes it easier to understand existing systems. Most large object-
oriented systems use these design patterns. People learning object-oriented programming often complain that
the systems they're working with use inheritance in convoluted ways and that it's difficult to follow the flow of
control. In large part this is because they do not understand the design patterns in the system. Learning these
design patterns will help you understand existing object-oriented systems.
These design patterns can also make you a better designer. They provide solutions to common problems. If you
work with object-oriented systems long enough, you'll probably learn these design patterns on your own. But
reading the book will help you learn them much faster. Learning these patterns will help a novice act more like
an expert.
Moreover, describing a system in terms of the design patterns that it uses will make it a lot easier to understand.
Otherwise, people will have to reverse-engineer the design to unearth the patterns it uses. Having a common
vocabulary means you don't have to describe the whole design pattern; you can just name it and expect your
reader to know it. A reader who doesn't know the patterns will have to look them up at first, but that's still easier
than reverse-engineering.
We use these patterns in our own designs, and we've found them invaluable. Yet we use the patterns in arguably
naive ways. We use them to pick names for classes, to think about and teach good design, and to describe
designs in terms of the sequence of design patterns we applied [BJ94]. It's easy to imagine more sophisticated
ways of using patterns, such as pattern-based CASE tools or hypertext documents. But patterns are a big help
even without sophisticated tools.
An Adjunct to Existing Methods
Object-oriented design methods are supposed to promote good design, to teach new designers how to design
well, and to standardize the way designs are developed. A design method typically defines a set of notations
(usually graphical) for modeling various aspects of a design, along with a set of rules that govern how and when
to use each notation. Design methods usually describe problems that occur in a design, how to resolve them,
and how to evaluate design. But they haven't been able to capture the experience of expert designers.
We believe our design patterns are an important piece that's been missing from object-oriented design methods.
The design patterns show how to use primitive techniques such as objects, inheritance, and polymorphism.
They show how to parameterize a system with an algorithm, a behavior, a state, or the kind of objects it's
supposed to create. Design patterns provide a way to describe more of the "why" of a design and not just record
the results of your decisions. The Applicability, Consequences, and Implementation sections of the design
patterns help guide you in the decisions you have to make.
Página