View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sp02 Final Exam Review: Displaying Alarm Status

Edit Sp02 Final Exam Review: Displaying Alarm Status here.


Uploaded Image: alarmDesign.jpg
The classes that might be needed are

The Gen-Spec relationships are between Alarm, FireAlarm, and IntruderAlarm. The part-whole relationships are between the AlarmSystem, Alarm and MessageHandler.

To implement model/view communication I would have to create a new class AlarmView which handled all of the functionallity for displaying the status of the alarms. The communication between AlarmSystem and AlarmView would be done utilizing the principles of MVC. In the initialization of the AlarmSystem class I would add AlarmView as a dependent( self addDependent: AlarmView).

In order to do this I would have to make a few changes to the design. I would want to add an attribute to the Alarm class called vicinity that tells you were the alarm is located. Then you would have to make the AlarmSystem dependent on the alarms. So when an alarm is triggered a changed method is sent to AlarmSystem. Then it has to figure out which alarm has gone off. Once it has done this it changes the attributes for that particular alarm, and signals the AlarmView that there has been a change in the AlarmSystem status. The AlarmView will then update everything that it needs to on the view.
Eric Soto
Nice job, Eric. More could be said on the last paragraph. What are the MVC issues here, e.g., "has to figure out which alarm has gone off."? Mark Guzdial

a view can be dependent on its model, then the model is responsible for announcing that it has changed a specific aspect of itself, and dependent view(s) are asked if they would like to update based on what aspect changed ellie



Link to this Page