Composite Strutures
Massimo Felici
Room 1402, JCMB, KB
0131 650 5899
mfelici@[Link]
Composite or Internal Structures
A Composite Structure is a set of
interconnected elements that exist at
runtime to collectively provide some piece of
functionality – Internal structures
Internal Structures specify relationship in
the context of the class that contain them
Internal Structures model how objects
work together inside a class or how they
achieve a goal
© 2004-2006 SEOC - Lecture Note 09 2
Composite Structures: Basics
Internal structures show
• the parts contained by a class and the
relationships between the parts
• context-sensitive relationships, or relationships
that hold in the context of a containing class
Ports show how a class is used on your
system with ports
Collaborations show design pattern in your
software and, more generally, objects
cooperating to achieve a goal
© 2004-2006 SEOC - Lecture Note 09 3
Internal Structures
Property Part
Structured classes and properties
Parts of a Class
• UML 2.0 defines the term “property” to describe the “part” piece
of the whole relationship
A Connector is a link that enables communication between parts
• The notation for multiplicities on connectors is the same as
multiplicities on associations
© 2004-2006 SEOC - Lecture Note 09 4
Ports
A port is a way to offer
functionality from a composite
structure without exposing the
internal details of how that
functionality is realized
Ports focus on the outside of a
class, showing how a class is
used by other classes
• Required and provided
interfaces
• behavioral port: realizing port
implementations
• Multiple connectors – UML 2.0
allows multiple connectors
leading from a port to different
internal elements
• Port multiplicity; interaction
points [Agile Modeling, Introduction to the Diagrams of UML 2.0]
• Port typing
© 2004-2006 SEOC - Lecture Note 09 5
Collaborations
UML 2.0 allows you to
attach a collaboration
to a specific operation
or classifier to show
how it is realized by
other elements
When you associate a
collaborations, yoy
create a Collaboration
Occurrence
[Agile Modeling, Introduction to the Diagrams of UML 2.0]
© 2004-2006 SEOC - Lecture Note 09 6