Tutorial Class ERD PDF
Tutorial Class ERD PDF
Each
department is managed by a chair, and at least one
professor. Professors must be assigned to one, but
possibly more departments. At least one professor
teaches each course, but a professor may be on
sabbatical and not teach any course. Each course may
be taught more than once by different professors. We
know of the department name, the professor name, the
professor employee id, the course names, the course
schedule, the term/year that the course is taught, the
departments the professor is assigned to, the
department that offers the course.
Practice Example
2 Class Diagrams
2.1 Elements of a class diagram:
2.1.1 class
A class is a general concept (represented as a square box).
A class defines the structural attributes and behavioural
characteristics of that concept. Shown as a rectangle
labeled with the class name.
Class Name
2.1.2 association
Class 1
Association
Class 2
Food
Class 2
Member
has-a relationship
2.1.2.1 binary
Person
Eats
2.1.2.2 n-ary
Class 1
n-ary
Class 3
2.1.2.3 Aggregation
Team
page 1 of 14
2.1.2.4 Composition
Car
is-composed-of relationship
Engine
2.1.2.5 Generalization
Car
is-a-kind-of relationship
Volvo
2.1.2.6 Dependency
The source class depends on (uses) the
target class. (not used for requirements
analysis)
Project
Project Manager
Team
2.1.2.7 Realization
Class supports all operations of target
class but not all attributes or associations.
(not used for requirements analysis)
datatype
Human Resources
datatype
Project Manager
Worker
datatype
System Administrator
page 2 of 14
Association Class
class 2
class 1
2.1.3 attribute
What is known about each object of this
class type. Typical characteristics.
class 1
-attribute 1
-attribute 2
-attribute 3
2.1.4 operation
What objects of this class type do. Typical
actions that are relevant to the current
analysis.
class 1
-attribute 1
-attribute 2
-attribute 3
+operation 1()
+operation 2()
+operation 3()
page 3 of 14
3.6 Identify Behaviours Specify the operations that are required for each class. (assume getter and setter
methods for each attribute.)
4.1.2 Relationship
A relationship is a semantic
association between one or more
entities.
4.1.3 Attribute
Key Attribute
Attribute 1
Entity 1
Attribute 2
Attribute 3
page 4 of 14
page 5 of 14
5 Practice Example
The University of Toronto has several departments. Each department is managed by a
chair, and at least one professor. Professors must be assigned to one, but possibly more
departments. At least one professor teaches each course, but a professor may be on
sabbatical and not teach any course. Each course may be taught more than once by
different professors. We know of the department name, the professor name, the
professor employee id, the course names, the course schedule, the term/year that the
course is taught, the departments the professor is assigned to, the department that
offers the course.
5.1
Class Diagram
chair
managed by
manages
assigned to
(aggregate)
offered by
professor
is assigned
(aggregate)
is a
course
offers
teaches
taught by
page 6 of 14
Professor
0..*
0..*
1..*
1..*
offers
assigned
1..*
Department
Chair
manages
1
Course
-name
-schedule
-term
Professor
0..*
0..*
-name
-employee id
1..*
1..*
offers
1
assigned
1..*
Department
Chair
manages
-name
-is chair
1
page 7 of 14
Course
-name
-schedule
-term
+modify schedule()
0..*
Professo
-name
-employee id
+prepare material()
+teach lecture()
+evaluate assignments()
0..*
1..*
offers1..*
1
1..*
assigned
Department
-name
+add Course()
+add professor()
+remove course()
+remove professor()
+change chair()
manages
1
Chair
-is chair
+create policy()
+evaluate professor()
page 8 of 14
page 9 of 14
page 10 of 14
page 11 of 14
name
dept. name
employee id
employee id
employee id
course name
course name
Department
(1,*)
Is assigned
(1,1)
Dept-Prof
Dept. Name
Employee ID
(1,*)
(1,1)
offers
has
(1,1)
(1,*)
Professor
Employee ID
(0,*)
Teaches
(1,1)
Course name
Employee ID
Course
Prof-Course
has
(1,*)
(1,1)
(1,*)
page 12 of 14
Course name
(1,*)
Is assigned
(1,1)
Dept-Prof
Dept. Name
Employee ID
(1,*)
(1,1)
offers
has
(1,1)
(1,*)
Professor
Employee ID
(0,*)
Teaches
(1,1)
Course name
Employee ID
Course
Prof-Course
has
(1,*)
Course name
Schedule
(1,1)
(1,*)
page 13 of 14
Term
page 14 of 14