Reference no: EM133221
Question
Assume we have three classes: AlarmClock, Beeper, and AlarmWindow. In following you see an interaction showing an AlarmClock sending show message to an AlarmWindow and the beep message to Beepers when it receives alarm message (i.e. when the clock's alarm event occurs, it sends these messages).
Now assume you have been asked to change these classes so they collaborate according to the Observer pattern. Suppose that AlarmClocks are publishers and Beepers and AlarmWindows are observers.
a. What is an interface (name each method and give a short description of each method) that AlarmClocks must implement?
b. What is an interface (name each method and give a short description of each method) that Beepers and AlarmWindows must implement?
c. illustrate a class diagram to show the relevant classes, methods, associations, and navigability for your adaptation to Observer pattern.
d. Rewrite above interaction to show how clock, b1, b2, and window interact according to an Observer pattern.