Professional Documents
Culture Documents
Module04 UML Ch5 Relationships
Module04 UML Ch5 Relationships
Relationships
UML
Associations
Fusion
Relationships
OMT
Associations
open() Event
close()
dependency
generalization
association
Lawrence Chung CS6359.0T1: Module 4 4
Dependency
A change in one thing may affect another.
Uses relationship.
May have a name, but not common.
AudioClip
name
Microphone
record(m:Microphone)
start()
stop()
dependency
direction indicator:
how to read relation name
relationship name
Professor Course
teaches
Fusion Style
Ternary association
Project Language
Person
You have two files, say Homework1 and MyPet, where Homework1 is
accessible only by you, but MyPet is accessible by anybody.
You could create two classes, File and User. Homework1 and MyPet
are files, and you are a user.
Approach 1: Now, would you associate the file access right with File?
Approach 2: Or, would you associate the file access right with User?
association class
class association name
Worker 1..* works for *
employee
Company
employer
+setSalary( s : Salary)
+setDept( d : Dept)
assign(development)
w : Worker : Company
File User
link attribute
access permission
UML Association Class
File * 1..* User
class class
AccessRight
access permission association class
part whole
multiplicity
1..*
Department Company
association
aggregation
Using relationship
CourseSchedule
Usually initial class diagrams will not have any significant number of
dependencies in the beginning of analysis but will as more details are identified.
Lawrence Chung CS6359.0T1: Module 4 15
Modeling Single
Inheritance
Look for common responsibilities, attributes, and operations that are
common to two (2) or more classes.
If necessary, create a new class to assign commonalities.
Specify that the more-specific classes inherit from the more-general.
In UML, abstract classes and their
Security operations would be italicized.
But not in Rational Rose
presentValue()
abstract
history()
is-a-kind-of relationship
PreferredStock CommonStock
1
School Department 0..1
has
1..*
1..*
1..* 1..*
assigned to
member
The model above is from Rational Rose. How did the composite symbol ( )get loaded versus the
aggregation? Use the Role Detail and select aggregation and then the by value radio button.
Body Car
Composite is a stronger form of aggregation. Composite parts live and die with the whole.