Key Relationships
-
Adapter - Bridge* - Composite - Decorator - Facade - Flyweight* - Proxy
These patterns are classified as
structural design patterns.
[GoF, p10]
-
Adapter
provides an alternative interface
for an (already existing) class or object.
-
Bridge*
lets an abstraction and its implementation
vary independently.
-
Composite
composes (already existing) objects
into a tree structure.
-
Decorator
provides additional functionality
for an (already existing) object.
-
Facade
provides an unified interface
for (already existing) objects
in a subsystem.
-
Flyweight*
supports large numbers of fine-grained
objects efficiently.
-
Proxy
provides additional functionality
when accessing an (already existing) object.
-
Composite - Builder - Iterator - Visitor - Interpreter
-
Composite
provides a way to represent a part-whole hierarchy
as a tree (composite) object structure.
-
Builder
provides a way to create the elements of an object structure.
-
Iterator
provides a way to traverse the elements of an object structure.
-
Visitor
provides a way to define new operations for the
elements
of an object structure.
-
Interpreter
represents a sentence in a simple language
as a tree (composite) object structure (abstract syntax tree).
-
Composite - Flyweight
-
Composite
and
Flyweight
often work together.
Leaf objects can be implemented as shared flyweight objects.
-
Composite - Chain of Responsibility
-
Composite
and
Chain of Responsibility
often work together.
Existing composite object structures can be used to define
the successor chain.
Background Information
-
Structural design patterns
(shown in the second row of the main menu)
are concerned with providing alternative behavior for
already existing classes or objects (without touching them).
-
Bridge* and
Flyweight*
should be classified as behavioral design patterns
(shown in the third row of the main menu)
that are concerned with
designing related classes and interacting objects
having a desired behavior.