The Mediator design pattern provides a solution:
Define a separate Mediator
object that encapsulates how a set of objects interact.
Objects interact with a
Mediator object
instead of interacting with each other directly.
Describing the Mediator design in more detail is the
theme of the following sections.
See Applicability section for all problems Mediator can solve.
Mediator object
that controls and coordinates the
interaction.
Mediator
object:
Mediator | mediate()).
Mediator1,…) that
implement the interaction behavior by
controlling and coordinating the interaction
between colleagues.
Mediator (sub)classes.
Mediator
object
(mediator.mediate()).