Assignment 2 Class and State Diagrams

profileLisa ap
SampleUMLClassDiagramforITOTClasses.pdf

Sample ITOT Case Study Class Diagram Page 1

Sample UML Class Diagram for Instructor, Course, and Expertise Areas Classes

The diagram below was created with a CASE tool and shows a portion of the class diagram for the ITOT Case Study. This class diagram includes the classes Instructor, Course, and ExpertiseArea with their attributes, operations, and relationships with multiplicity constraints. There are notes for the Class Diagram and the CASE tool.

1. Sample Class Diagram

Sample ITOT Case Study Class Diagram Page 2

2. Class Diagram Notes

This diagram represents the classes Instructor, Course, and Expertise Areas and their relationships (associations) to each other. Attributes, operations, as well as relationships with multiplicity constraints are represented. The details are deduced from the ITOT Requirement Specification.

Classes and Relationships

1. Instructor and Course Relationship

An Instructor teaches 0..* Course(s).

Each Course is taught by exactly 1 Instructor

(Business rules may be applied to the relationships. Instructors may or may not be teaching at a given time. Courses are taught by only one Instructor.)

2. Course and Course (reflexive) Relationship

Each Course may have 0..* prerequisite Course(s)

Each Course may be a prerequisite for 0..* Course(s)

(This is an example of a recursive relationship of a class to itself.)

3. Instructor and ExpertiseArea Relationship

An Instructor is qualified in 1..* ExpertiseArea(s).

Each ExpertiseArea is a qualification for 0..* Instructor(s).

(Since all Instructors have teaching areas of expertise and there are many areas, it was decided to make ExpertiseArea into a class rather than an attribute of Instructor. Then we can use a relationship to connect Instructor to ExpertiseArea. )

Sample ITOT Case Study Class Diagram Page 3

3. CASE Tool Notes

Much of this diagram is automatically generated by the CASE tool. For example when you start to add attributes, you can right click on the class and select the option to Add attributes with Getter and Setter methods. All of the getter/setter method entries will be automatically generated. The getter methods make the values of the attributes available to other classes. The setter methods allow the values of attributes to be changed.

The first method listed is called a Constructor which will create a new instance of the class. This is also automatically generated by right clicking on the class and selecting the option to add constructor. You can also add parameters (attributes) to the Constructor so that a complete Constructor is created and it will include all attributes.

Changes to each class can be made directly through the Specification dialog box. Just right click on the class or relationship and choose the Open Specification option. You can also change the listing order of the attributes or operations by selecting the item and using the arrows to move it up or down, then click apply, and OK in the Specification dialog box.

  • 1. Sample Class Diagram
  • 2. Class Diagram Notes
  • 3. CASE Tool Notes