Geog 495: GIS Database Design
10/19/05
UML Class Diagram
Object:
Class:
Class is a template for instantiation of objects
Class Diagram is composed of classes and relationships
Class
Attribute
<<sterotype>>opt
visibilityopt name
multiplicityopt : typeopt = initial-valueopt {property-string}opt
What is visibility?
What is scope?
Operation
<<sterotype>>opt
visibilityopt name(parameter-list) : return-typeopt
{property-string}opt
e.g.
+ getX(): double
+ setX(newX: double)
The concepts of visibility and scope are applied to operation too.
Relationships
Multiplicity
Number of participants (classes) involved in an association
Navigability
Direction of navigation between classes
Implementation concept
class Quiz{ // A
list of questions
Question [] questions; .... }
Role name
Constraints
Class diagram can be created from three different perspectives
Lab
Here’s a business rule and details of classes to be implemented
Draw UML diagram
Class Information
Course has attribute {name, id}, and operation {getDescription}
Section has attribute {time, semester, cancelled}, and operation {cancel}
CourseSchedule has attribute {semester}, and operation {enroll}
Student has attribute {name, major}, and operation {planSemester}
Coop has attribute {semester}, and operation {getCompany}
where all attributes can be accessed by only the class containing attributes while all operations can be accessed by all classes
Relationship Information
Course may has section or multiple Sections
CourseSchedule is associated with Section only if section is not cancelled
Student look up CourseSchedule
Student live at Coop
Coop is operated by Company