The Unified Modeling Language (UML) Class Diagrams
The Unified Modeling Language (UML) Class Diagrams
(UML)
Class Diagrams
Unified Modeling Language
• A standardized modeling language for the
conceptualization and design of software
systems
• Two types of diagrams: structure diagram and
behavior diagram
• There are a lot of diagram types in the UML
(14 types!) but we will focus only on a few in
this class
Common Structure Diagrams
• Class Diagram
– Illustrates classes, with attributes and methods, along with their
relationships
– We will focus primarily on class diagrams, since they are by far
the most commonly used
• Component Diagram
– Illustrates how components (each with an API or similar
connecting interface) interfaces with other components
• Object Diagram
– Illustrates the objects instantiated in a system at a single point in
time
• Package Diagram
– Illustrates the packages in a system and their dependencies
Common Behavior Diagrams
• Activity Diagram
– A “flow chart” of sorts
• Interaction Diagram
– The message sequence chart is one type of
interaction diagram
• Use Case Diagram
– Represents Actors and their respective use-cases
• State Machine Diagram
– Displays states and transitions
Class
Class/Object Name
Attributes
Methods/Operations
An employee is a person
Association
14
Representing Aggregation/composition in Classes
Composition Aggregation
An aggregation / composition relationship is usually represented as a data field in the aggregated class.
15
Inheritance
Inheritance models the is-an-extension-of
relationship between two classes.
16
Class diagram of Point of sale system
• Association
No ownership
Own lifecycle
• Aggregation
Ownership ( has a..)
Own lifecycle
• Composition
Ownership (composed of ..)
No Own lifecycle
• Inheritance
Is relationship