Patterns: The Top Ten Misconceptions

John Vlissides

Object Magazine, March 1997

Along with all the hubbub these days about patterns comes more than a little confusion, consternation, and misinformation. This is partly a reflection of how new the field is to mainstream software developers (although it's not, strictly speaking, a new field). It's a fast-moving field too, which creates vacuums of facts. And yes, we pattern proponents deserve some of the blame for not educating people as thoroughly as we'd like, though not for lack of trying [Buschmann+96, Coplien96, Gamma+95, PLoPD95, PLoPD96].

This is my humble attempt at dispelling the more egregious misconceptions about patterns---misconceptions I've heard often enough to qualify as patterns in their own right. (I actually toyed with using a pattern form to articulate them. Then it dawned on me that reducing everything to patterns was itself a misconception!) Keep in mind that the opinions expressed herein are my own; I'm not speaking for the pattern community. I expect most pattern cognoscenti would agree that these are prevalent misconceptions, but I don't expect them to agree with how I dispel them. If all I do is start a dialog on these issues, I'll declare success.

Mulling over what I've heard people say about patterns over the years, the misconceptions seem to fall into three categories: misconceptions about what patterns are, about what they can do, and about the community that's been promoting them. Each of my "top ten" fall into one of these categories. So I'll organize them accordingly, looking first at misconceptions about what patterns are.

Misconception 1: "A pattern is a solution to a problem in a context"

This is one of Alexander's definitions, and calling it a misconception will be heresy to some. But a simple counterexample will make its deficiency clear:
Problem: How do I redeem my winning lottery ticket before it expires?

Context: The dog ate the ticket an hour before the deadline.

Solution: Cut the dog open, fish out the ticket, and run to the nearest redemption station.

This is a solution to a problem in a context. It is not a pattern. What's missing? At least three things:
  1. Recurrence, which makes the solution relevant in situations outside the immediate one.
  2. Teaching, which gives you the understanding to tailor the solution to your variant of the problem. Most of the teaching in real patterns lies in the description and resolution of forces, and/or the consequences of application.
  3. A name by which to refer to the pattern.
To be sure, a satisfactory definition has proven elusive, as witnessed by the on-going debate in the pattern-discussion mailing list [PDML]. Contributing to the difficulty is the fact that a pattern is both a thing and a description of similar things. One way to differentiate the two is to use the term "pattern" consistently to refer to the description of the thing and use "pattern instance" to refer to a concrete application of a pattern.

At any rate, defining terms may prove a futile exercise, because a definition that's meaningful to one audience (say, programmers) might be totally meaningless to another (say, executives holding the purse strings). So I won't try to come up with the ultimate definition here. Suffice it to say any definition that stipulates a pattern's constituent parts must talk about recurrence, teaching, and naming in addition to problem, solution, and context.

Misconception 2: "Patterns are just jargon, rules, programming tricks, data structures...."

I call this "the belittling dismissal." It's natural to try to reduce something unfamiliar to something known, especially if you're not motivated to investigate the unfamiliar. And all too often, people put old wine in new skins and call it innovation. It's good to be wary. But the belittling dismissal does not come from experience. Often it's based on superficial familiarity, with an added dash of cynicism. Besides, nothing is ever totally new; people have had patterns in their heads for as long as there have been heads. What's new is that we've started naming the patterns and writing them down.

Now about those comparisons: There is in fact a pattern jargon---terms like "pattern" itself, "forces," Alexander's "quality without a name," and so forth---but patterns hardly reduce to jargon. Compared to most areas of computer science, patterns introduce comparatively few new terms. That's symptomatic, actually. A good pattern is intrinsically accessible to its audience. It may well use the jargon of its target domain, but there's rarely a need for pattern-specific terminology.

Neither are patterns rules you can apply mindlessly; the teaching component should counteract any such tendency. Nor are they limited to programming tricks, even though the "idioms" branch of the discipline focuses on patterns that are programming language-specific. The term "tricks" is a tad pejorative to my ear, and it overemphasizes solution at the expense of problem, context, teaching, and naming.

No doubt you've heard of an innovation's three stages of acceptance: first it's dismissed as rubbish, then it's merely nonviable, and finally it's obvious and trivial---"What we've done all along." Patterns aren't entirely out of stage 1 yet.

Misconception 3: "All patterns are created equal."

Broad-brushing is unfair as a rule, and that goes double for pattern broad-brushing. There's a bewildering range of pattern domains, content, scope, styles, and quality---just flip through one of the Pattern Languages of Program Design books [PLoPD95, PLoPD96] and you'll see. Patterns are as diverse as the people who write them, perhaps even more so; authors like Alistair Cockburn, Jim Coplien, Neil Harrison, and Ralph Johnson (to name a few) have gone beyond their initial forays to write patterns of varied styles and domains.

Misconception 4: "Patterns need tool or methodological support to be effective."

Having written, used, and helped others use patterns over the past five years, and having helped perpetrate at least one pattern-based tool [Budinsky+96], I can state confidently that the benefit from patterns comes mostly from applying them as they are, that is, with no support of any kind.

When I speak on this topic, I usually point out four main benefits of patterns:

  1. They capture expertise and make it accessible to nonexperts.
  2. Their names collectively form a vocabulary that helps developers communicate better.
  3. They help people understand a system more quickly when it is documented with the patterns it uses.
  4. They facilitate restructuring a system whether or not it was designed with patterns in mind.
For the longest time I thought item 1 provided the bulk of the benefit. Now I realize that item 2 is at least as important. Think about it: How many bytes of information flow between developers, either verbally or electronically, in the course of a development project? My guess is megabytes if not gigabytes. (I collected several dozen megabytes of e-mail that circulated among us "Gang of Four" as we wrote Design Patterns [Gamma+95]. My guess is that our effort approximates that of a small-to-medium-sized software development project.) With so much communication going on, anything that makes it incrementally more efficient would yield substantial time savings. Patterns effectively expand people's communication bandwidth.

In short, patterns are primarily food for the brain, not fodder for a tool. There may yet be latent benefit in methodological or automated support, but I'm convinced it'll be icing on the cake, not the cake itself or even a layer thereof.

* * *

The misconceptions I've looked at so far have to do with what patterns are. Now for a few misconceptions about what patterns can do. These come in two flavors: the overstating kind and the understating kind.

Misconception 5: "Patterns guarantee reusable software, higher productivity, world peace, etc."

This one's easy, because patterns don't guarantee anything. They don't even make benefit likely. Patterns do nothing to remove the human from the creative process. They merely bring hope of empowerment to a possibly inexperienced, perhaps merely uninitiated, but otherwise capable and creative person.

People speak of good patterns producing an "Aha!" response. That can only occur if the pattern strikes a chord in the reader's mind. If it doesn't, then the pattern is like the proverbial tree that falls in the forest with no one around to hear it---did it fall? So it is with patterns: what good is a pattern, no matter how well written, if it doesn't produce a resonance in the human mind?

Patterns are just another weapon in the developer's arsenal. To ascribe much more to them is counterproductive. Underpromise and overdeliver---that's the best defense against hype and backlash.

Misconception 6: "Patterns 'generate' whole architectures."

This misconception is like unto the last one, except that it's less aggressive in its overstatement.

The generative aspect of patterns gets discussed periodically in the pattern forums. As I understand it, generativity refers to a pattern's ability to create "emergent behavior." That's a fancy way of saying the pattern helps the reader solve problems that the pattern doesn't address explicitly. Some of what I've read suggests that true generativity makes this happen almost in spite of one's self.

To me, the key to generativity is in the parts of a pattern dedicated to teaching---the forces and their resolution, for example, or the discussion of consequences. These insights are particularly useful as you define and refine an architecture. But believing that patterns themselves can generate architectures or anything else is definitely over the top. Patterns don't generate anything; people do, and they do so only if both they and the patterns they use are up to snuff.

Misconception 7: "Patterns are for (object-oriented) design or implementation."

At the other end of the spectrum are unduly limiting misconceptions like this one. Frankly I'm surprised anyone would think it. But enough people have asked me about it to propel it into my top ten. If it seems overly naive to you, skip to the next misconception.

Patterns are nothing if they don't capture expertise. The nature of that expertise is left open to the pattern writer. Certainly there's expertise worth capturing in object-oriented software design, but there's just as much to be had in non-object-oriented design---and not just design but analysis, maintenance, testing, documentation, organizational structure, on and on. Patterns in these varied areas are now emerging: already there are at least two books on analysis patterns [Hay96, Fowler97], and each PLoP conference attracts new kinds of patterns. (A particularly interesting submission to the 1996 conference concerned patterns for music composition!)

Like most misconceptions, there's a grain of truth in this one. When you look at the pattern forms people use, you see variations on two basic styles: the highly structured GOF (Gang of Four) style used in Design Patterns, and the near-belletristic style of Christopher Alexander---narrative, with minimal structure. Having dabbled in pattern writing for something other than object-oriented design, I now recognize how biased the GOF style is toward its domain. It just plain doesn't work for other areas of expertise I've tried: What should the Structure diagram look like for a C++ idiom? The implementation trade-offs in a pattern for music composition? The Collaborations in a pattern for good expository writing?

Clearly, one pattern format does not fit all. What does fit all is the general concept of pattern as a vehicle for capturing and conveying expertise, whatever the field.

Misconception 8: "There's no evidence that patterns help anybody."

This one held water in the past, but not anymore. People are reporting benefits from patterns in journals like Software---Practice and Experience [Kotula96] and conferences like OOPSLA [Hueni+95, Schmid95] and ICSE [Beck+96]. Doug Schmidt has articulated several benefits in the context of teaching computer science to undergraduates and graduates [Schmidt96]. While most of this evidence is anecdotal, I know of at least one group that is conducting controlled experiments in an attempt at more quantitative results [Tichy96].

As time progresses, we'll get a better handle on the benefits (and pitfalls) of pattern usage. The initial returns are promising; we need more experience to fully assess the impact. It would be foolish indeed to reject patterns out of hand just because their performance remains to been measured.

* * *

So much for fallacies about what patterns can do. The last two misconceptions concern not patterns per se but the community that has championed them.

Misconception 9: "The pattern community is a clique of elites."

I'd love to know how these notions get started, because if there's a noteworthy aspect of the pattern community, it is its diversity. This is easily gauged from the attendees of PLoP and EuroPLoP---people from all over the world, from large corporations and small startups; analysts, designers, and implementers; students and professors; big-name authors and fledglings. I was surprised to learn that more than one regular attendee isn't even a computer scientist! The community is still in flux. Each year yields a bigger crowd and a slightly different mix of backgrounds.

Given the pattern community's penchant for publishing, one might wonder at the relative paucity of academics. The fact is that the majority of people who attend PLoP are practitioners. It seems to have always been so. Not one of the prominent early proponents of software patterns---including Kent Beck, Ward Cunningham, and Peter Coad---comes from an academic background. Only one of the Gang of Four (Ralph) is from academia, and he's the most applied academic I know. The grass-roots nature of the pattern community is clearly at odds with any insinuation of homogeneity and elitism.

Misconception 10: "The pattern community is self-serving, even conspiratorial."

More than once I've heard the charge that patterns' primary use is as a source of revenue for those who write books about them. It has even been suggested the patterns "movement" has a nefarious agenda.

Poppycock!

Speaking as one of the Gang of Four, I can affirm that we were as surprised as anyone by the reaction to Design Patterns. Certainly none of us was ready for the feeding frenzy at its OOPSLA '94 debut---even the publisher was caught off-guard by the demand! Throughout the project our overriding concern was to create the highest-quality book we could. We were too busy just trying to understand this stuff to be distracted by sales issues.

That was then. Now that "pattern" has achieved buzzword status, it's inevitable that some will leverage the term for less than altruistic purposes. But if you read the works of leading pattern authors carefully, you'll sense a common and overarching desire: to take hard-earned expertise, best practices, even competitive advantage---the fruits of years of hands-on experience---and not just disclose it but impart it to all comers.

It is this passion for improving the reader's lot that motivates a sincere and effective pattern author. Anything less is self-defeating---and the ultimate misconception about patterns.

ACKNOWLEDGMENTS

Jim Coplien helped me spiff up this article in remarkably short order, and Ralph tracked down references while I was incommunicado. Thanks, guys!

References

[Beck+96] Beck, K., et al. "Industrial Experience with Design Patterns," Proceedings of the 18th International Conference on Software Engineering, Berlin, Germany, March 1996, pp. 103-114.

[Budinsky+96] Budinsky, F., et al. "Automatic Code Generation from Design Patterns," IBM Systems Journal, Vol. 35, No. 2 (1996), pp. 151-171.

[Buschmann+96] Buschmann, F., et al. Pattern-Oriented Software Architecture: A System of Patterns, Wiley, Chichester, England, 1996.

[Coplien96] Coplien, J. Software Patterns, SIGS Publications, New York, NY, 1996.

[Fowler97] Fowler, M. Analysis Patterns: Reusable Object Models, Addison-Wesley, Reading, MA, 1997.

[Gamma+95] Gamma, E., et al. Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, Reading, MA, 1995.

[Hay96] Hay, D. Data Model Patterns: Conventions of Thought, Dorset House, New York, NY, 1996.

[Hueni+96] Hueni, H., et al. "A Framework for Network Protocol Software," OOPSLA '95 Conference Proceedings, published as ACM SIGPLAN Notices, Vol. 30, No. 10, October 1995, pp. 358-369.

[Kotula96] Kotula, J. "Discovering Patterns: An Industry Report," Software---Practice & Experience, to appear.

[PDML] patterns-discussion@cs.uiuc.edu.

[PLoPD95] Coplien, Schmidt, eds. Pattern Languages of Program Design, Addison-Wesley, Reading, MA, 1995.

[PLoPD96] Vlissides, Coplien, Kerth, eds. Pattern Languages of Program Design 2, Addison-Wesley, Reading, MA, 1996.

[Schmid95] Schmid, H. "Creating the Architecture of a Manufacturing Framework by Design Patterns," OOPSLA '95 Conference Proceedings, published as ACM SIGPLAN Notices, Vol. 30, No. 10, October 1995, pp. 370-384.

[Schmidt96] patterns-discussion@cs.uiuc.edu, December 12, 1996.

[Tichy96] Personal communication, October 24, 1996.


©1997 by John Vlissides. All Rights Reserved.