Patterns
describe simple and elegant solutions to specific
problems in 00 software design. Each pattern
systematically names, explains, and evaluates an
important and recurring design in 00 systems.
Each
pattern has 4 parts:
Name,
which allows developers to speak the same
language.
Problem,
which describes when the pattern should be applied
and in what context it is appropriate.
Solution,
which is described in terms of the relationships,
responsibilities and collaborations of the objects
involved in the pattern.
Consequences
of using the pattern, such as the costs and
benefits of applying the pattern.
There
are 3 types of design patterns:
Creational
design patterns
concern the process of object creation. An
example is the Singleton pattern which
ensures that a class only has one instance, and
provides a global point of access to it.
Structural
design patterns
deal with the composition of classes or objects.
An example is the Composite pattern which
composes objects into tree structures to represent
part-whole hierarchies and allows clients to treat
individual objects and compositions of objects
uniformly.
Behavioral
design patterns
characterize the ways in which classes or objects
interact and distribute responsibility. An
example is the Observer pattern which
defines a one-to-many dependency between objects
so that when one object changes state, all its
dependents are notified and updated automatically.
Patterns
are language (and methodology) independent.
They can be used to capture common design
practices, frameworks and architectures.
They are also being used to capture existing large
legacy systems such as the 4E and GTD-5 switching
systems (at GTE and AT&T) and to examine ways
to re-engineer process and organizations (Coplien's
Process and Organizational Patterns).
Patterns
and Software Design. Thus, when using
patterns as part of software design methodology,
we get the term used throughout this web - Design
Patterns.