Assignment 1:
UML Revisit
ITFN 3314, Summer 2008
The Scheduling Program Specification: This
program allows a student to enter names of courses and the times the courses
meet. It detects time conflicts between courses and will display a schedule
for the student. The program assumes that classes meet only between 8:00
a.m. and 5:55 p.m. on weekdays. Your first task is to download the program
specification and take a look at the code. The program is broken up into
several classes:
Course.java: describes a course
CourseMeeting.java: describes
one "meeting" of a course (a lecture, tutorial or lab)
Time.java: describes a
time in hour and minutes, used for starting and ending times of the meetings
Schedule.java: describes a
student's schedule (what course meetings occur at what times)
ScheduleDay.java: describes
one day of a schedule
MainScheduleFrame.java: the
main program window (This is the "main" class for running the program)
RemoveCourseDialog.java: a
dialog for removing a course from the schedule
AddCourseDialog.java: a dialog
for adding a course to the schedule
AddMeetingDialog.java: a dialog
for specifying a course meeting
For your convenience, here is
a zip file containing all of the above files.
Notes About GUIs: One of the first things
you'll notice about this program is that it uses a Graphic User Interface (GUI).
For many of you, this will be the first time you've looked at Java code for
a GUI. Don't panic; we don't expect you to understand it all.
Note About Vectors: This program uses
Vectors to store its data. If your knowledge of Vectors is rusty, you
can consult any basic Java text or the Java
API documentation. Technically, a Vector in Java is a list of Objects
of any type at all, which is similar to C#. For example, a Course
contains a list of CourseMeetings.
You don't need to show the Vector
class in your class diagram. The meaning you want to show is that a Course
references a list of CourseMeetings,
so you should show a relationship directly from Course
to CourseMeeting, just as if we
had used an array of CourseMeetings
instead.
Tasks
1: Class Diagrams
Your first task, after you have looked over the program and run it, is to draw
two UML class diagrams. The first one should show all of the classes in
the program and their relationships. For each class, you can just draw
a simple box; you don't need to show attributes and methods. Each relationship
arrow should include a name, navigability arrows, and multiplicities on each
end. The program uses many classes from the Java API (Vector, JOptionPane,
etc.), and you don't have to include these. However, the GUI classes extend
classes from the API and/or implement interfaces from the API and these should
be shown.
The second class diagam should be a detailed diagram of the Course class.
It should include all attributes and method, both public and private.
It should use the UML notation to show which are public and which are private.
It should show the types of all attibutes, return types of all methods, and
the names and types of all method parameters.
2: Activity Diagram
Draw a UML activity diagram showing how a user interacts with this program.
3: Sequence Diagram
Draw a sequence diagram showing the interactions between objects when a
user adds a course with two course meetings to his/her schedule. In this
scenario, there will be no conflicts and the course will be added successfully.
Your diagram must include the GUI objects (frame and dialogs) as well as objects
of classes such as Course and CourseMeeting.
4: Use Case Diagram
We also want to ask you to practice writing a use case diagram for this
assignment, but a use case diagram for this simple program wouldn't be very
interesting. Instead, we'd like you to imagine a much fancier scheduling
program. University administrators could specify the courses and when
the meet, and students could sign up for the courses without having to tell
the program when the courses meet. The program could perform other Q-Card-like
functions, including limiting the size of classes, checking pre-requisites,
etc.
Draw a use case diagram for such a scheduling program. Your diagram must
include at least two actors and three use cases, and at least one "extends"
or "uses" relationship. (Reminder: the use cases are the ovals.
You don't have to draw three diagrams, just one diagram with at least three
use cases in it.)
We have not given you a precise specification for the scheduling program, so
there isn't a specific correct answer for this part of the assignment.
Any actors and use cases that sound reasonable for a scheduling program will
be accepted. The point of this exercise is to determine if you understand
and can use the notation. For this part, you must hand in the following: