COMP 304B Object-Oriented Software Design - Assignment 2
Practical information
- This assignment is worth 8% of your final grade.
- Due date: Friday, February 5th, 2010, before 23:59.
- The TA for this assignment is Chris Dragert. Ask your questions on WebCT or make
an appointment to meet with Chris.
- 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!
- Your submission on WebCT 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 feedback about the assignment workload, provide the number of hours you spent
on this assignment.
Goals
This assignment will make you familiar with UML class diagrams, and code
generation from them.
The grading scheme is as follows:
- Task 1 (50%):
- Image & datafiles of your class diagram using BoUML (40%)
- Image & datafiles of your class diagram using another tool (10%)
- Task 2 (10%):
- Short analysis of the tools (5%)
- List of criteria and the relative weights you give them (5%)
- Task 3 (30%):
- Datafiles & class files generated from BoUML (10%)
- Sample application with correct output of all calls to prettyPrint() (15%)
- Image of the object diagram snippet (5%)
Upload all images, datafiles, source files and result files to WebCT and
provide links to all of them from your index.html file.
Also include any additional information the corrector might require to correct the
assignment.
Your submission should consist of three distinct directories: Task1, Task2,
and Task3.
Assignment
The I.T. department of a medium-sized consulting firm requires an inventory system.
This system would allow them to individually track every piece of computer equipment
used by the company. This includes computers, monitors, printers, etc. This is especially
important given that the company has several offices located across North America.
The system should keep track of the following characteristics of equipment:
- Its type (such as Computer, Monitor, Printer)
- Its serial number (such as N3JEKW357EA)
- Its model number
- Information about its purchase (such as date, store, warranty expiration)
- Who is currently assigned to this piece of equipment
- Its location (such as Montreal Office, Toronto Office)
In addition,
- every piece of computer equipment that needs to be tracked has a special bar code
sticker on it which uniquely identifies it in the system. This bar code is a random
unique number assigned by the system.
- a piece of equipment can only be assigned to one employee at a time.
The system also keeps track of employees. Although not as complete as a Human Resources
(HR) system, it does record the following information :
- Name of the employee
- Employee gender (male/female)
- His/her title
- His/her department
- His/her supervisor
- His/her location (such as Montreal Office, Toronto Office)
- His/her coordinates (such as address, phone, cell)
- List of pieces of equipment currently assigned to him/her
- List of pieces of equipment assigned to him/her in the past (and when !)
Some information about locations is also stored :
- Name of the location
- Number of offices in that location
- List of (references to) employees in that office
- Employee responsible for I.T. maintenance at that office and his/her coordinates
- List of equipment found at that location
Task 1
Draw a UML class diagram to model the above inventory system.
- Possibly start by informally drawing the diagram on paper. Do not need hand it in.
- Draw your diagram using BoUML and one other different UML design tools. You get
to choose which one. Note that Dia and MagicDraw should be installed
on the Trottier Linux machines.
- Submit your design drawn in two tools. Pick the one you like best. This diagram
will be corrected as your primary solution: we will be looking at the cardinalities,
attributes, proper syntax, correct association types, ...
Task 2
- Describe in 200 words (+/- 10%) why you picked this particular diagram and not another.
In other words, compare the UML design tools.
- Describe your evaluation criteria (such as ease of installation, use, support for
UML 2.0, ...) and the weight you give to them. You can include BoUML in your comparison.
Task 3
- From the class diagram designed in BoUML, generate the code for the classes to the
target language Python.
- Provide a single method in each class that allows to pretty print the instance it
is called on (similar to a toString). The prettyPrint() method must return a string
which completely depicts the state of the object with the values at the time it
is called. Note that you should not touch the generated code once synthesised.
The implementation of your methods must be written in BoUML. When correcting this
part, we will re-generate your design in Python and run it as is.
- Implement a main procedure that creates a sample application modelling the tracking
system instance. The example must show every class of your design at least once.
- Draw an object diagram which shows the objects and their links at run-time. You
can limit yourself to 20 objects.
UML Software
Here is a non-exhaustive list of some UML tools you could use to do this assignment.
You can find more UML tools on
Wikipedia
Make sure you can use the tool to draw UML 2.0 diagrams.
Eugene Syriani Winter Term 2010.