154 Internet of Things
The Structure
The Composite Structure Diagram shows the internal parts of a class. We have to name the parts
as; partName:partType[multiplicity]. The aggregated classes could be a part of a class, but the
parts are not always necessarily classes. A part is like an element that is utilized to make up the
containing class.
Composite Structure Diagrams are very similar to class diagrams. However, they depict the
individual parts instead of entire classes. But before we can explain the internal structure of a clas-
sifier, we either need to show its structure compartment or explore a composite structure diagram.
Then only we can portray the parts that serve as the instances owned by the container classifier.
We can also add connectors to connect two or more parts in a union or dependency relationship.
Components of the Diagram
Part
Part works like an element that is responsible for representing a set of one or more instances.
These instances are mainly owned by a containing classifier instance.
Port
A port works like a typed element and is responsible for representing an externally visible part
of a containing classifier instance. Ports are useful in defining the interaction among a classifier
and its environment. A port can come out on the border of a contained part, a class, or a com-
posite structure.
Interface
An interface is very similar to a class. However, it has a number of restrictions on it. We should
know that all the interfaces are abstract and public, and they do not provide any kind of default
implementation. The attributes in an interface must be constants.
Delegate
A delegate is used as a connector for explaining the internal works of a component’s interfaces
and external ports.
Collaboration
Collaboration is done when a set of co-operating roles utilized collectively to represent a specific
functionality. Usually, collaboration shows only the attributes and roles that are required to
accomplish a defined function or a task.
Role Binding
We draw a role binding connector from collaboration to the classifier that accomplishes the role.
Represents
We draw the represents connector from collaboration to a classifier to represent that
collaboration has been used in the classifier.
Occurrence
We draw occurrence connector from collaboration to a classifier to represent that collaboration
serves as the classifier.
State Chart Diagrams
The name, State Chart Diagram itself tells us about the purpose of such a diagram. These
diagrams are used in explaining dierent states of a component inside a system. The states
could be very specific to the object/component of a system. They work as the illustration
Internet_of_Things_CH06_pp141-170.indd 154 9/3/2019 10:14:19 AM