Create a program with this problem using the “Observer pattern”, STRICTLY
When a Message is sent to a Mailing List, the Mailing List sends a
copy of the Message to every Inbox that has subscribed to the List.
When an Inbox receives a message, it displays this notification:
New Message received. You have 1 unread message(s).
A Message Board can subscribe to a List. When it receives a new
Message, it displays the following about the 5 latest Messages: From,
Subject. It displays the Messages in reverse order, latest Message
first.
An Inbox can:
1. Display all Messages - displays following about the Messages: Message No.*, From, Subject
2. Display all unread Messages - same display as 1
3. Display a Message given a Message No. - displays From, Subject, and Body; marks the Message as read
4. Mark all Messages as read
*The same Message can have a different Message Nos. in different Inboxes.
Create a main class called MailingListTester, and simulate the following:
Inbox1 subscribes to the Mailing List.
Inbox2 subscribes to the Mailing List.
Message Board subscribes to the Mailing List.
A Message is sent to the Mailing List.
Inbox1 displays all Messages.
Inbox1 displays the latest Message sent.
Inbox2 displays all unread Messages.
A Message is sent to the Mailing List.
Inbox1 marks all Messages as read.
Inbox2 displays all unread Messages.
Inbox2 displays the latest Message sent.
Note: cReate your own observers..
i have two programming exerise and this one is very difficult..huhu:-/
pleaseee...