Mediator API Documentation
- class Mediator(*args, **kwargs)[source]
Bases:
ProtocolDefines the interface for the Mediator.
A mediator facilitates communication between different Colleagues.
- class Colleague(mediator)[source]
Bases:
ABCAbstract base class for Colleagues in the Mediator pattern.
Colleagues communicate with each other through a Mediator.
- Parameters:
mediator (Mediator)
- __init__(mediator)[source]
Initializes the colleague with a given mediator.
- Parameters:
mediator (
Mediator) – The Mediator that the colleague will use to communicate.- Return type:
None
- class ConcreteMediator[source]
Bases:
MediatorConcrete implementation of the Mediator interface.
Facilitates communication between registered colleagues.
- __init__()[source]
Initializes the mediator with an empty list of colleagues.
When created, the mediator has no colleagues registered.
- Return type:
None
- class ConcreteColleague(mediator, name)[source]
Bases:
ColleagueConcrete implementation of the Colleague class.
Represents a participant in communication facilitated by the Mediator.
- __init__(mediator, name)[source]
Initializes the concrete colleague with a given mediator and name.