Professional Documents
Culture Documents
Class Diagram
Objects
• Object Diagram
• Class Diagram
• Ref.: chapter 4
Truck
Conceptual entity
Chemical Process
Software entity
Linked List
ProfessorClark
Class Name Only
Professor Clark
Class
Course
Properties
Name a + b = 10
Location
Days offered
Credit hours
Start time
End time Behavior
Add a student
Delete a student
Get course roster
Determine if it is full
a + b = 10
Professor Class
//Class //Class
public class Client {} public class Account {}
// Object
// Object
Client sam = new Client();
Account acc1 = new Account();
Client jill = new Client();
Professor Jones
Analysis and Design of IS 14
What is an Attribute?
Object
Class
Attribute Value
Course101
Attribute
No = 101
: CourseOffering StartTime = 900
EndTime = 1100
+ No: number
+ StartTime: number
+ EndTime: number Course104
+ …() No = 104
+ …() StartTime = 1300
EndTime = 1500
Class
: CourseOffering
+ No: number
+ StartTime: number
Operation + EndTime: number
+ AddStudent()
+ DeleteStudent()
+ GetStartTime()
+ GetEndTime()
Java code
Analysis and Design of IS 17
What is an Interface?
Realization relationship
Analysis and Design of IS 18
Relationships
• Association
Aggregation
Composition
• Dependency
• Generalization
• Realization
Association
Class
Role Names
Whole Part
Aggregation
Composition
• Unspecified
• Exactly one 1
• Zero or more (many, unlimited) 0..*
*
• One or more 1..*
• Zero or one 0..1
• Specified range 2..4
• Multiple, disjoint ranges
2, 4..6
Multiplicity
Navigation
ClientPackage SupplierPackage
Dependency
relationship
Analysis and Design of IS 30
Relationships: Generalization
Superclass
(parent)
Generalization
Relationship
Subclasses
(child)
Descendents
Multiple inheritance
Superclass
(parent)
generalization
Subclass
(child)
aggregation
http://creately.com/blog/diagrams/class-diagram-relationships/
Analysis and Design of IS 36
Class Diagram for the Sales Example
Sale
Unidirectional
Bi-directional