Professional Documents
Culture Documents
Techniques (CMM005)
Lecture 4 – Part 2
Introduction to UML
Relationships
Figure from: Booch, Rumbaugh & Jacobson. The UML User Guide
© The Robert Gordon University K. Hui 2008-2009 11
Interface as Stereotype Class
<<interface>>
URLStreamHandler
openConnection()
parseURL()
setURL()
toExternalForm()
Shape2D()
perimeter()
area()
islarger()
Circle Rectangle
radius:double height,width:double Square
Circle() Rectangle()
perimeter() perimeter() Square()
area() area()
© The Robert Gordon University K. Hui 2008-2009 16
Association
links between objects
i.e. instances of classes
"is-associated-with-a" relationship
"uses-a", "has-a"
a solid line
with optional multiplicity and role names
association with
Student is taking Module name &
1..* 6 multiplicity
whole Company
aggregation
1
*
part Department
has
0..1
School Department
1 1..* 1..* 1..*
1..*
assignTo
member
1..* 0..1
* 1..*
attends teaches
Student Course Instructor
* * * 1..*
Figure from: Booch, Rumbaugh & Jacobson. The UML User Guide
© The Robert Gordon University K. Hui 2008-2009 25
Realisation
an interface specifies a contract
a class that implements an interface
guarantees to carry out the contract
<<interface>>
Observer TargetTracker
update()
<<interface>>
Shape2Di
Circle Rectangle