Lab 15
Lab 15
Group: IT1-2107
Name: Seidygali Daryn
Mediator Pattern
Documentation:
Objects:
Mail Server (Mail Server): It is a central mail server that receives, sends
and stores emails.
The intermediary is also responsible for receiving new emails from the
server and notifying users of new messages.
The E-mail Mediator also receives notifications of new emails from the
Mail Server and notifies the relevant users.
// MailServer.java
public class MailServer {
public void sendEmail(String sender, String recipient, String message)
{
import java.util.HashMap;
import java.util.Map;
emailMediator.registerUser(alice);
emailMediator.registerUser(bob);
}
}
Diagram: