System Level Design Languages:Composite Structure Diagram
Composite Structure Diagram
Elements of a composite structure diagram are shown in Figures 86.23–86.26. An example of a composite structure diagram is shown in Figure 86.27. A composite structure diagram is new in UML 2.0, and it emphasizes on interactions between classifiers in a system, how they collaborate with each other, and their interfaces. A structured classifier is one of the elements used in this diagram (Figure 86.23 and Figure 86.24). It has one or more ports, parts, and interfaces. Other elements used in this diagram are
collaborations (Figure 86.25), and connectors between a collaboration (dotted eclipse) and a structured classifier (Figure 86.26).
In composite structure diagrams, a classifier, like that of Figure 86.23, contains parts, ports, and interfaces. Each part shows a set of instances. A part can be deleted before its parent is destroyed (e.g., the classifier in Figure 86.23). Parts are shown by rectangles inside the classifier.
Another element in the classifier is a port, which is a typed element that shows the visible parts of the classifier. Ports can be considered as the interaction gates between a classifier and its outside environment. A port can offer a classifier service to the environment it is in, and it can also provide the requirements of its containing classifier. It is shown as a small named rectangle on the boundary of its containing classifier.
An interface is a special case of a class. It has several operations which are all public for other classifiers. These operations are abstract, meaning that they have no implementation in the interface itself. If a classifier wants to use an interface, it must implement its operations itself, or it must use the other classifier’s implementations to use that interface. An interface is similar to a set of rules in a design. A classifier that uses an interface must follow these rules. An interface operation can have more than one implementation. There are two kinds of interfaces in UML: provided and required (PIF1 and RIF1 in Figure 86.23).
If a classifier has a provided interface (the upper interface in Figure 86.23), the classifier has implemented the operation of that interface. This implies that a realization link exists between that classifier and the interface. In other words, the classifier can provide the services of that interface to other elements.
If a classifier has a required interface (RIF1 in Figure 86.23), it means that the classifier needs the operations of that interface, and the classifier must use the implementation of that interface operation from another classifier that has implemented the interface. A provided interface link between a classifier and an interface is shown by a line ending with a circle, while a required interface between a classifier and an interface is shown by a line ending with a half circle. An interface is displayed as a class with the ((interface)) stereotype.
To specify the elements that are involved in a port or an interface of a classifier, the delegate connector between that element and the specified port or interface is used (see Figure 86.24). A delegate connector is a connector with the ((delegate)) stereotype that originates from an element in a classifier to the specified port of interface in the boundary of that classifier.
The preceding paragraphs discussed various elements of a classifier that can be used in a composite structure diagram. In what follows, we will discuss collaborations that are also used as elements in composite structure diagrams. Before defining a collaboration, we need to define roles. A role, in UML, specifies a set of features an instance must have. A collaboration is a set of roles, collaborating with each other, to accomplish a required functionality. In other words, a collaboration explains how a system (or part of it) works.
A collaboration is a classifier containing several instances. Two instances that have a collaboration are connected with a simple line. A collaboration is shown with a dashed ellipse and it has a name. An example of collaboration is shown in Figure 86.25.
If a classifier performs a desired role defined in a collaboration, then it is said that there is a role binding connection between the collaboration and the classifier (Figure 86.26). A role binding connection is shown by an arrow with the ((role binding)) stereotype.
Other connector types between UML collaborations and classifiers are represents and occurrence. A represents connection shows that the classifier uses the collaboration. It is shown by the ((represents)) stereotype. An occurrence connection shows that the collaboration represents the classifier. It is shown by the ((occurrence)) stereotype.
With what was discussed above, we are now ready to display a complete composite structure diagram for SSimBoard using the structured classifiers and the collaborations. This is shown in Figure 86.27.
Comments
Post a Comment