Software Patterns
A concept borrowed from architecture is applied to more and more software
analysis and design:
"Each pattern describes a problem which occurs over and over again
in our environment, and then describes the core of the solution to that
problem, in such a way that you can use this solution a million times over,
without ever doing it the same way twice"
-Christopher Alexander
Thus, the four essential elements of a pattern are:
-
name: to describe a problem, its solution, and consequences in a
word or two
-
problem: when to apply the pattern, including its context
-
solution: elements that make up the model, their relationships,
responsibilities and collaborations
-
consequence: results and trade-offs of applying the pattern
How patterns are useful
Design patterns are potentially useful in both developing new designs,
and as an aid in
comprehending existing OO designs. While the former use is the best
documented, the latter will
become more important as time goes on.
Using patterns in developing new designs
The hope of the design patterns community is that over time a large number
of patterns will be
compiled and published and that they will become part of the everyday
vocabulary of software
designers. To this end, most patterns literature today consists of
catalogs of software patterns.
The motivation behind such catalogs is that as designers face problems
in the course of OO design,
they will look to the various patterns catalogs for solutions to particular
design problems. This is
probably the best use of design patterns for the near future, and early
results have shown that they
can be successfully used in this manner.
Using patterns to understand existing designs
Besides being useful as a tool in the development of new OO designs,
one of the most interesting
uses of design patterns is in the documentation of existing designs.
Patterns form a basis from which
a knowledgeable engineer can come to comprehend a complex design.
Design patterns can form a shared vocabulary with which engineers can
converse about design
decisions. An important feature of the design pattern format is the
discussion of the "forces" or
tradeoffs that each design pattern addresses and which the solution
resolves. If an engineer can
understand that a particular design pattern has been used as part of
an OO design, he can make
certain assumptions about the constraints that were placed on the design.
Once the constraints are
understood, he can understand the capabilities and limitations of that
section of the system.
Pattern recovery
Related Links