308-304B Object-Oriented Design -- Assignment 4\\\
Due date: Tuesday April 16, 2002 before 23:55
308-304B Object-Oriented Design - Assignment 4
Due date: Tuesday April 16, 2002 before 23:55
Practical information
1 < = team size < = 2
Each team submits only one full solution.
Include name(s) and ID(s) in every submitted file.
Use the index.html template provided on the
assignments page.
The other team member (if any) must submit a single
index.html file containing coordinates of both team
members. This will allow us to put in grades for both team
members in WebCT.
Your submission must be in the form of a simple HTML
file (index.html) with explicit references to
all submitted files as well as inline inclusion of
images.
A Class Diagram based on the Observer Pattern customized
for our Spreadsheet application as well as comments describing
this design.
Python code. You starting point is the solution of assignment 3 on the one hand
and the following revision of assignment 1 (to be used as a ConcreteSubject) on the
other hand.
You are quite free in your design (and implementation) as long
as the following minimum requirements are satisfied:
All GridViews (concrete observers) must reflect the central SpreadsheetData
(concrete subject).
The application will start by creating a single SpreadsheetData instance
(the concrete subject).
Whenever the user asks to instantiate a new GridView, this is done.
At creation time, the GridView constructor
gets a reference to the SpreadsheetData passed
as an argument.
A GridView will, upon creation, attach itself to the subject.
The subject will not only be informed of who is attaching but also
of the width and height covered by that particular observer.
Note that when a GridView terminates, it must detach from the subject !
When a cell changes in a GridView, the subject state will be set.
The SpreadsheetData setState() will be responsible for notifying
all appropriate observers.
Only those observers observing the changed data will be notified.
A "push" approach will be used: the data will be sent directly
to the appropriate observers (who will not have to ask the subject for the state).
(UPDATE) A newly-created GridView must be updated with the contents of the
subject (i.e., GridView1 is created and edited. Then GridView2 is created. This new
GridView should be consistent with the current state of the subject).