You are on page 1of 4

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/220424606

The Pros and Cons of Adopting and Applying Design Patterns in the Real
World

Article  in  Communications of the ACM · October 1996


DOI: 10.1145/236156.236167 · Source: DBLP

CITATIONS READS

64 5,523

1 author:

Marshall Cline

14 PUBLICATIONS   303 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Marshall Cline on 16 June 2014.

The user has requested enhancement of the downloaded file.


The Pros and Cons of Adopting and Applying
Design Patterns in the Real World

M a r s h a l l P. C l i n e

patterns are a valuable lifecycle. Even though the patterns requires that the design patterns be

D
ESIGN
tool for the practicing software and their names were different part of one’s flesh and blood—
professional. There are a num- from those in standard use today looking things up in a book would
ber of pragmatic benefits from (they were largely reinvented by the be completely unacceptable in
using design patterns, and, not author, since the project predated these on-the-fly situations.
surprisingly, there are also a the standard design patterns text
number of common problems. [3] by several years), they were Design patterns can be used to give the
This sidebar shows project man- nonetheless uniform across the software a hinge. One of the great
agers and object-oriented (OO) project teams, and this uniformity lies about OO is that it can be used
designers some of the organization- allowed the developers to commu- to build arbitrarily adaptable soft-
al as well as technical issues that nicate at a higher level of abstrac- ware. In reality, adaptability must
come up when design patterns are tion. Design patterns were an be explicitly designed into the soft-
introduced into a software produc- important component to the over- ware in designated places. OO soft-
tion shop. all success of this project [1]. ware is more like a human body
than a piece of silly putty: rather
Practical Benefits: Design patterns can be used reactively. than being arbitrarily adaptable
Design patterns coordinate the entire Design patterns can be used as a along every possible direction, it
process and community. Design pat- documentation tool to classify the has hinges or hot spots [4] in those
terns provide a standard vocabulary fragments of a design, making it specific, designated places where
among developers. They provide a easier for a team to absorb new the software is designed to
list of things to look for during a developers. For example, many of bend/adapt. Future changes con-
design review and a list of things the team’s design philosophies are sistent with one of these hinges are
that must be taught in a course on captured explicitly rather than relatively inexpensive, but forcing
OO design. They communicate strictly being in the heads of the the software to change in other
information between designer, pro- original team. ways is like bending your elbow
grammer, and maintenance pro- backwards; the system normally
grammer at a significantly higher Design patterns can be used proactively. breaks.
level than individual classes or func- Patterns are more than a documen- For example, if a customer wants
tions. tation tool. In addition, they can be to add new kinds of Foibles and/or
These advantages of design pat- used to build robust designs with customize the way Foibles are dis-
terns scale well to large organiza- design-level parts that have well played, it may be possible to build a
tions. We have applied them on a understood trade-offs. Using business case that justifies the
three-year project with 150 design patterns this way requires added expense of reducing the cost
OO/C++ developers. Almost every the designer to perform a degree of to add Foibles and/or change their
developer was trained and men- high-level pattern matching, as well display. These are two hinges; they
tored using a uniform set of design as to have the ability to abstract the are places where the software is
patterns, and these patterns were essence of the design problem from designed to bend over time. Each
used throughout the development the morass of details. It also of these hinges will probably be

q,q,q.q,q,q.q,q,q.q,q,q.q,q,q.q,q,q.q,

COMMUNICATIONS OF THE ACM October 1996/Vol. 39, No. 10 47


built using one or more design offs. Rather than forcing them to
patterns [2]. choose between what would typi-
Unfortunately, the software cally be mutually exclusive quali-
community is not very good at ties, these design patterns let the
dealing with hinges. Methodolo- designer give the software both
gies focus almost exclusively on qualities simultaneously. For
functional requirements, whereas example, one normally has to
hinges are nonfunctional require- choose between generality and
ments. Very few methodologies performance, but several patterns
explicitly take hinges into account allow arbitrary generality you pay
during requirements analysis (e.g., for only if you use (e.g., the Com-
use cases are functional, yet hinges posite Pattern provides this quality

.q,q, are also requirements), when esti-


mating cost of the system (func-
tion points are functional, yet
with recursive structures).

Design patterns constrain mainte-


q.q,q
The bottom line is
hinges are also expensive), during
testing (testing checks what the
software currently does rather
nance programmers. Hinges are rel-
atively expensive to design and
build, and some hinges can have
,q.q, than how easy it is to change the
software to do something else;
extraordinarily high business
value. Yet despite their cost and
that every OO
q,q.q hinges/adaptability should be
explicitly tested), financial reward
system (most first-line managers
their value, a hinge can be
destroyed by a careless change
that fixes a defect. Note that the

,q,q.
designer should learn
have a nine-month event horizon;
their job is to build it; they are not
rewarded if version two is cheap,
concern here is not that a change
may break another functional
requirement. The concern is that
q,q,q
how to apply design
nor are they penalized if version
two is expensive).
a change may remove the soft-
ware’s ability to bend in ways that

.q,q,
Despite our failure as an indus- it was previously able to bend.
try to adequately manage hinges, Since few testing methodologies
they are extraordinarily impor- explicitly test the hinges, mainte-

q.q,q patterns.
tant, especially in today’s rapidly
changing business environment.
If a software system is not adapt-
nance programmers are rarely
aware of the damage they have
wrought.

,q.q, able, a company could miss a nar-


row market window. Some recent
billion dollar losses have been
Design patterns help this prob-
lem. The likelihood that a mainte-
nance change will destroy
traced to inflexible software sys- adaptability is significantly
tems. reduced when designers explicitly
Design patterns are one of the document the design patterns
first ways to explicitly manage used to build a hinge, particularly
hinges. Some of the most useful when management puts processes
patterns are those that provide in place that require maintenance
hinges. For example, the Abstract programmers to understand and
Factory Pattern makes it easy to preserve the integrity of these
add new kinds of derived classes (a design patterns during mainte-
hinge), even though parts of the nance changes.
system have to create objects of
these new derived classes. Design patterns let management
reward self-directed designers: For bet-
Design patterns can turn a trade-off ter or worse, today’s business cli-
into a win-win situation. Very often mate often makes it necessary for
a designer has to make a choice developers to expend unpaid over-
between two high-priority quali- time to keep their skills sharp.
ties. Some of the most useful Thus, differentiating self-directed
design patterns are those that let a developers from the others is an
designer work around these trade- important management problem.

q,q,q.q,q,q.q,q,q.q,q,q.q,q,q.q,q,q.q,

48 October 1996/Vol. 39, No. 10 COMMUNICATIONS OF THE ACM


Even though this differentiation is patterns, and the adaptability of terns. For example, some of the
a nontechnical problem, design the system’s design patterns criteria used to categorize design
patterns can help. should be explicitly tested. patterns do not appear to map to
In practice, an OO designer mental models used by the aver-
needs personal time and personal Some design patterns are unnecessarily age developer. This is a fruitful
initiative to become skillful in difficult to learn. Some design pat- research opportunity that crosses
design patterns. For instance, a terns are simply too difficult for discipline boundaries between
design pattern usually needs to be the average OO designer to learn. computer science and psychology.
used in a toy example before it can In some cases, the pattern is inher- For example, psychological stud-
be used under fire. Unfortunately, ently deep. Unfortunately, in ies should be conducted to see
some software professionals are other cases the pattern is not how typical software designers cat-
not self directed and are only will- deep, but it is given a name egorize patterns in their own
ing to put in the necessary time if and/or description that isn’t obvi- minds, and the formal categoriza-
they are paid for it. ous. This is probably the inevitable tion of design patterns should be
The bottom line is that every result of the increase in the num- redone to reflect these natural cat-
OO designer should learn how to ber of people proposing new egories.
apply design patterns. Designers design patterns, and the frequency
who are unable or unwilling to of those proposals. Whatever the Conclusion
learn the basic OO design patterns cause, it is a practical problem The software project manager and
[3] simply should not be doing when patterns are adopted by an OO designer can expect to benefit
OO design. Those who are willing organization, since murky, obfus- from applying design patterns. To
to put in the personal time needed cated design patterns tend to dis- maximize this benefit, design pat-
to truly understand design pat- tract people from the clarity of terns should be applied uniformly
terns should be rewarded with many writers and the depth of throughout the organization, and
continued employment and possi- their design patterns. expectations should be managed
bly with increased responsibilities. In our experience of training carefully.
and mentoring thousands of soft- Like any new discipline, it takes
Inhibitors to Patterns ware professionals in OO design time for the design pattern
Applications patterns, we found it helpful to approach to mature. However, if
Design patterns have been oversold. start with a vastly simplified state- the software development organi-
Design patterns are overly hyped. ment of a pattern’s purpose. After zation is willing to adapt its
They cannot possibly deliver the the developers understand this processes to weave design patterns
benefits that some have naively sound bite, they can graduate to throughout the software lifecycle
stated. Almost everyone in the the fully general discussions and and to invest in appropriate train-
design patterns community has descriptions that usually accompa- ing and mentoring, there are prac-
been concerned about this for ny a design pattern when it is pub- tical benefits available now. C
some time, but unfortunately, lished.
some consultants either do not References
understand the limits of the tech- Design pattern classifications are not 1. Berg, B., Cline, M. and Girou, M.
Lessons learned from the OS/400 OO
nology or worse. yet useful for practitioners. Design project. Commun. ACM 38, 10 (1995).
Design patterns have their patterns are classified along vari- 2. Cline, M. and Fayad, M. Object-Oriented
place, and they are very important, ous axes, such as purpose, scope, Design Patterns (1995) Course notes,
especially when adaptability is a and jurisdiction. These classifica- 800 pages.
valuable nonfunctional objective. tions are helpful to people who 3. Gamma, E. et al. Design Patterns. Addi-
son-Wesley, Reading, Mass., 1995.
But adaptability is still not free, already understand design pat- 4. Pree, W. Design Patterns for Object-Orient-
and the benefits of using design terns, especially when determin- ed Software Development. Addison-Wesley,
patterns will be wasted unless the ing whether a newly proposed Reading, Mass., 1995.
overall software development pattern is redundant with another 5. Schmidt, D. Using design patterns to
develop reusable object-oriented com-
process is modified to take design pattern that already exists. The munication software. Commun. ACM 38,
patterns into account. For exam- classifications have also helped 10 (1995).
ple, every code review should organize the huge number of pat-
make sure the code accurately terns, as there are now so many
reflects the constraints of the patterns it is very difficult to Marshall P. Cline is president of Paradigm
Shift, Inc., Potsdam, N.Y., cline@parashift.
appropriate design patterns, every remember them all. com.
maintenance change should be However, some of the cate-
evaluated to make sure it doesn’t gories are not helpful to software
break the constraints of the design practitioners while they learn pat- ©ACM 0002-0782/96/1000

,q,q.q,q,q.q,q,q.q,q,q.q,q,q.q,.q,q.q,

COMMUNICATIONS OF THE ACM October 1996/Vol. 39, No. 10 49


View publication stats

You might also like