COMP 304B Object-Oriented Software Design -- Assignment 1
COMP 304B Object-Oriented Software Design - Assignment 1
Practical information
- Due date: Monday February 7, 2005 before 23:55.
- Team size == 2 (pair programming) !
- Each team submits only one full solution.
Use the index.html template provided on the
assignments page. Use exactly this
format to specify names and IDs of the team members.
The other team member must submit a single
index.html file containing only the coordinates of
both team members. This will allow us to put in grades for
both team members in WebCT. Beware: after the submission deadline
there is no way of adding the other team member's
index.html file and thus no way of entering a grade !
- 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. See the general assignments page for an
index.html template.
- The submission medium is
WebCT.
- To get insight into the assignment workload, provide the number of
hours you spent on this assignment.
Goals
This assignment will make you familiar with unit testing,
with a UML modelling tool such as MagicDraw,
and with object-oriented programming in Python.
Your assignment solution should clearly present:
- The tests corresponding to the requirements listed below.
- A Class Diagram depicting your design.
- An implementation of your design in Python.
- The results of the tests on your implementation.
Upload all source and result files to WebCT and provide
links to all of them from your index.html file.
Requirements
The ultimate goal is to build a fully functional PlotWindow, integrated
into the DSheet spreadsheet application.
The following figure shows what a PlotWindow will look like.
Note that in this assignment, you will ONLY design and
implement the non-visual part of the PlotWindow !
A PlotWindow instance will be known to applications using
it by a name. This name is not known by the
PlotWindow itself.
A PlotWindow has a title, as well as an
x_name and y_name describing the x and y axes
respectively. All of these are Strings.
Both in x and y directions a min and max
value describe the "window" through which the trajectories will be
viewed. These are all floating point numbers.
A PlotWindow may contain an arbitrary number of
Trajectory objects.
Each Trajectory has a unique name, and an
arbitrary number of Point objects.
Each Point object has an x and y
coordinate, both of which are floating point numbers.
It should be possible to create/query/modify/and delete
PlotWindow, Trajectory, and Point
objects. This should happen through appropriate methods.
Do NOT allow direct access to attributes !
Concerning modification: it must be possible to append
Points to a Trajectory.
Design
Use a UML drawing tool of your choice to produce a Class Diagram.
Unit Testing
You must produce a list of tests (mention their type) to check whether
the above requirements are satisfied in an implementation.
Note that you will have to refine the requirements yourself.
These test should be implemented in a file test.py using the
PyUnit testing framework.
References
Hans Vangheluwe January 2005.