UML Composite Structure Diagrams
Composite Structure Diagram could be used to show:
- internal structure of a classifier - internal structure diagram,
- classifier interactions with environment through ports,
- a behavior of a collaboration - collaboration use diagram.
The term "structure" for this type of diagrams is defined in UML as a composition of interconnected elements, representing run-time instances collaborating over communications links to achieve some common objectives.
Internal Structure Diagrams
Internal structure diagram shows internal structure of a classifier - a decomposition of that classifier into its properties, parts and relationships.
The following graphical elements are typically drawn in a composite structure diagram which shows internal structure of a classifier: class, part, port, connector, usage.
Composite structure diagram overview shows elements of internal structure of structured classifier - roles, parts, connectors.
You can see some examples of internal structure diagrams here:
- Internal Structure - Bank ATM Composite Structure
- Internal Structure - Tomcat 7 Server Composite Structure
Collaboration Use Diagrams
The behavior of the system is the functionality that the system under design will implement or which is already implemented by some existing system. Objects in a system typically cooperate with each other to produce the behavior of a system.
A behavior of a collaboration will eventually be exhibited by a set of cooperating instances (specified by classifiers) that communicate with each other by sending signals or invoking operations. However, to understand the mechanisms used in a design, it may be important to describe only those aspects of these classifiers and their interactions that are involved in accomplishing a task or a related set of tasks, projected from these classifiers.
Collaborations allow us to describe only the relevant aspects of the cooperation of a set of instances by identifying the specific roles that the instances will play.
Interfaces allow the externally observable properties of an instance to be specified without determining the classifier that will eventually be used to specify this instance. Consequentially, the roles in a collaboration will often be typed by interfaces and will then prescribe properties that the participating instances must exhibit, but will not determine what class will specify the participating instances.
The following nodes and edges are typically drawn in a composite structure diagram which shows behavior of a collaboration: collaboration, connector, part, collaboration specialization, dependency.
Collaboration elements - roles, parts, connectors.
Collaboration Visit shows cooperation of doctor and patient roles.
Collaboration use represents one particular use (occurrence) or application of the pattern described by a collaboration to a specific situation involving specific classes or instances playing the roles of the collaboration. A collaboration use shows how the pattern described by a collaboration is applied in a given context, by binding specific entities from that context to the roles of the collaboration.
Collaboration use elements - roles, parts, role binding.
Collaboration use childVisit represents one particular use
of the Visit collaboration.
Classifier (in internal structures and collaborations) is extended with the capability to own collaboration uses. These collaboration uses link a collaboration with the classifier to give a description of the behavior of the classifier.
One of the collaboration uses owned by the classifier may be selected as representing the behavior of the classifier as a whole. The collaboration related to the classifier by this collaboration use shows how the instances corresponding to the structural features of this classifier (e.g., its attributes and parts) interact to generate the overall behavior of the classifier.
The representing collaboration may be used to provide a description of the behavior of the classifier at a different level of abstraction than is offered by the internal structure of the classifier. The properties of the classifier are mapped to roles in the collaboration by the role bindings of the collaboration use.
You can see an example of collaboration diagram here:
- Collaboration Use as Design Pattern - Observer Pattern