Package Behavioral.Mediator
Interface Mediator
- All Known Implementing Classes:
ConcreteMediator
public interface Mediator
Interface for the Mediator in the Mediator Pattern.
The Mediator facilitates communication between different colleagues.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddColleague(Colleague colleague) Registers a colleague with the mediator.voidsendMessage(Colleague sender, String message) Sends a message from one colleague to others.
-
Method Details
-
sendMessage
Sends a message from one colleague to others.- Parameters:
sender- The colleague sending the message.message- The message to send.
-
addColleague
Registers a colleague with the mediator.- Parameters:
colleague- The colleague to register.
-