Design patterns
1
Coupling of Design Patterns: Common Practices and Their Benefits
William B. McNatt James M. Bieman
Computer Science Department
Colorado State University
Fort Collins, CO 80525 USA
McNatt: +1-303-971-2271, Bieman: +1-970-491-7096 william.b.mcnatt@lmco.com, bieman@cs.colostate.edu
Abstract
roles in both patterns. A change in parts of one pattern can affect the behavior of the other pattern.
Object-oriented (OO) design patterns define collections of interconnected classes that serve a particular purpose. A design pattern is a structural unit in a system built out of patterns, not unlike the way a function is a structural unit in a procedural program or a class is a structural unit in an OO system designed without patterns. When designers treat patterns as structural units, they become concerned with issues such as coupling and cohesion at a new level of abstraction.
We examine the notion of pattern coupling to classify how designs may include coupled patterns. We find many examples of coupled patterns; this coupling may be “tight” or
“loose”, and provides both benefits and costs. We qualitatively assess the goodness of pattern coupling in terms of effects on maintainability, factorability, and reusability when patterns are coupled in various ways.
Keywords: Design patterns, object-oriented design, design quality, coupling.
1. Introduction
Design patterns are architectural units, just as classes are implementation units. We can view a system as a collection of interacting patterns and independent classes. Pattern instance attributes are potentially measurable in a manner similar to class attributes. Thus, we can examine notions such as pattern coupling.
Pattern coupling results from connections between patterns. Common classes can connect two patterns. They play roles in more than one pattern by referencing common objects, and by using