Composite Structure - Timing and Interaction Overview Diagram
Composite Structure - Timing and Interaction Overview Diagram
In UML models, a composite structure diagram depicts the internal structure of structured
classifiers by using parts, ports, and connectors. A structured classifier defines the
implementation of a classifier and can include a class, a component, or a deployment node.
You can use the composite structure diagram to show the internal details of a classifier and
to describe the objects and roles that work together to perform the behavior of the
containing classifier.
A composite structure diagram is similar to a class diagram, but it depicts individual parts
instead of whole classes. Before you can define the internal structure of a classifier, you must
either show its structure compartment or open a composite structure diagram. You can then
model the parts that represent the instances that the containing classifier owns. You can add
connectors to link two or more parts in an association or dependency relationship.
In composite structure diagrams, ports define the interaction point between a classifier and its
environment or between a classifier and its internal parts. You can use a port to specify the
services that a classifier provides to and requires from its environment.
You can also model collaborations and collaboration uses in composite structure diagrams. A
collaboration describes the roles and attributes that define a specific behavior of the classifier.
A collaboration use represents one particular use of the collaboration to explain the
relationships between the properties of a classifier. To identify the roles of the parts in the
collaboration use, you attach a collaboration use to a collaboration and then add the
collaboration use to a composite structure diagram.
As the following figure illustrates, a composite structure diagram is displayed in the diagram
editor as a frame that has the name of the containing classifier. The composite parts of the
classifier and their communication connections are displayed in the diagram frame.
The example in the figure shows how the composite structure diagram identifies the
containing classifier, Car. The diagram frame shows four internal composite parts of the
containing classifier, which represent the four wheels of the car and are of the type Wheel. A
communication link connects the front wheels and the rear wheels with connectors named
frontaxle and rearaxle.
Whenever you create a composite structure diagram from the Car classifier, four instances of
the Wheel class are created. These parts are held by composition within the Car instance and
the front wheels and the rear wheels are linked by connectors.
Parts
In composite structure diagrams, a part is a diagram element that represents a set of
one or more instances that a containing structured classifier owns. A part describes
the role of an instance in a classifier. You can create parts in the structure
compartment of a classifier, and in several UML diagrams such as composite
structure, class, object, component, deployment, and package diagrams.
Ports
In composite structure diagrams, a port defines the interaction point between a
classifier instance and its environment or between the behavior of the classifier and
its internal parts.
Collaborations
In UML diagrams, a collaboration is a type of structured classifier in which roles
and attributes co-operate to define the internal structure of a classifier. You use a
collaboration when you want to define only the roles and connections that are
required to accomplish a specific goal of the collaboration. For example, the goal of
a collaboration can be to define the roles or the components of a classifier. By
isolating the primary roles, a collaboration simplifies the structure and clarifies
behavior in a model.
Collaboration uses
In composite structure diagrams, a collaboration use is model element that
represents one use of a collaboration to explain the relationships between the parts
of a structured classifier. You use a collaboration use to apply a pattern, which is
described by a collaboration, to a specific situation that involves classes or instances
that play the roles of the specified collaboration. You can have multiple
collaboration uses that each involve a different set of roles and connectors for a
given collaboration.
Connectors in structured classifiers
In UML diagrams, a connector is a line that represents a relationship in a model.
When you model the internal structure of a classifier, you can use a connector to
indicate a link between two or more instances of a part or a port. The connector
defines the relationship between the objects or instances that are bound to roles in
the same structured classifier and it identifies the communication between those
roles. The product automatically specifies the kind of connector to create.
Parts
In composite structure diagrams, a part is a diagram element that represents a set
of one or more instances that a containing structured classifier owns. A part
describes the role of an instance in a classifier. You can create parts in the
structure compartment of a classifier, and in several UML diagrams such as
composite structure, class, object, component, deployment, and package
diagrams.
Parts are owned by composition and the composite structure diagram models how
the parts are connected in the containing classifier. Each part is a specific usage of a
type. The type defines the kinds of objects that can be bound, or referenced, to a
role. You can have multiple parts with the same type and each part can have a
different set of relationships to other parts. You can join parts with connectors to
specify the communication between them.
As the following figure illustrates, a part is displayed in the diagram frame as a solid
rectangle that contains the name of the part, the type, and any specified multiplicity.
A class icon is displayed in the top right corner of the part.
Ports
In composite structure diagrams, a port defines the interaction point between a
classifier instance and its environment or between the behavior of the classifier and
its internal parts.
Because all interactions between the external environment and the internal parts
must pass through a port, you can use a port to isolate the internal parts of an object
from its environment. Connectors link ports to properties of the classifier and invoke
communication between two or more instances. You can define multiple ports for a
classifier to show different interactions depending on the port from which the
interaction originates.
A port is displayed in the diagram frame as a small square with the name of the port.
You can add ports to the border of a composite structure diagram and to the interior
parts of the composite structure diagram.
For example, in the following figure, the diagram frame shows three parts. Two parts
are typed with the classifier Wheel and the third is typed by the classifier Engine. A
straight line named Delegate connector links the internal part named e:Engine to a
port on the external border of the composite structure diagram. The external port is
typed with the classifier Car and is named Port:Car. The connector has an open
arrowhead that points toward the external port. The two Wheel parts, named
front:Wheel[2] and rear:Wheel[2], are connected by straight lines named Assembly
connectors to the internal port named Port:Engine.
A port can interact in both directions and you can add required and provided
interfaces to specify the types of interactions that can occur between a classifier and
its environment.
For example, in the following figure, the diagram displays a Car classifier that has
one part, named carSeat:Seat, and two ports. A port, named DriverSeatbelt:Seatbelt,
appears on the part and there is a circle connected to the top of the port by a small
straight line. The circle represents a provide interface named SafetyDevice that the
Car class offers to the driver to operate the car. On the border of the composite
structure diagram, a port, named Engine:PowerGenerator, is attached by a solid line
to a half circle. The half circle represents a required interface named Gasoline that
the Car class needs to operate the car.
You can change the position of a port in a composite structure diagram by using the
isService property of the port. If the isService property is set to true, the port appears
on the border of the composite structure diagram, indicating that the port is required
by its environment. If you set the property to false, the port moves inside the
structure compartment, indicating that the port is used only for internal
implementation of the classifier and is not required by its environment. When the
isService property is set to false, you can delete or modify the port without affecting
the use of the classifier.
Timing diagram:
Communication diagrams, sequence diagrams and timing diagrams are different views of the
interaction. Timing diagrams focus on the timing or duration of the message or conditions in change
along a timeline in the diagram.
You create timing diagrams to represent a part of the timing of a system. You can use timing
diagrams to examine and further model time constraints and duration. You can create
multiple timing diagrams that each focus on a different lifeline or view of the interaction. The
elements that you add to a sequence diagram are not added to the corresponding timing
diagram. However, the elements that you add to a timing diagram are added to the
corresponding sequence diagram. You can add elements to the timing diagram by creating
new elements or by selecting existing elements. Timing diagrams are not canonical and
sequence diagrams are canonical. The timing diagram represents only a partial view of the
interaction and therefore does not contain all the elements of a sequence diagram.
Timing diagrams contain states or conditions. Sequence diagrams have state invariants that
closely resemble a state or condition. A state invariant in a timing diagram is interpreted as
the time, or duration, that the particular state invariant lifeline is in a specified state.
The following example shows a timing diagram that contains two lifelines, state invariants,
messages, duration observations and constraints and time observations and
constraints.
Interaction overview diagram:
Interaction Use
Large and complex sequence diagrams could be simplified with interaction uses. It is also
common to reuse some interaction between several other interactions.