The Bridge design pattern provides a solution:
Define separate inheritance hierarchies for
an abstraction and its implementation.
Abstraction
delegates its implementation
to an Implementor object
instead of committing to an implementation at
compile-time.
Describing the Bridge
design in more detail is the theme of the following sections.
See Applicability section for all problems Bridge can solve.
(Abstraction)
(Implementor).
Abstraction interface
is implemented in terms of (by delegating to)
an Implementor object
(imp.operationImp()).
Abstraction delegates its
implementation to
an Implementor object
imp.operationImp()).
Abstraction
can be configured with an
Implementor object,
and
even more, the Implementor object
can be exchanged at run-time.