The Agile Modeling (AM) Method

UML Composite Structure Diagrams: An Agile Introduction

UML 2 composite structure diagrams are used to explore run-time instances of interconnected instances collaborating over communications links. Figure 1 depicts a composite structure diagram for enrolling in a seminar. The dashed oval, Enroll in Seminar, models a collaboration. A collaboration enables you to model the relevant aspects of a cooperation between instances, indicating the objects and the roles that they take within the collaboration. The rectangles model instances of any type of classifier, including classes, objects, or interfaces. The properties used in the collaboration, such as the prerequisite seminars that a student has taken in the past, are optionally indicated with the classifier boxes.
Figure 1. Composite structure diagram for enrolling in a seminar.

An alternative form of this diagram is shown in Figure 2, something I refer to as a collaboration-style composite structure diagram. I’d really like to refer to this as a collaboration diagram, but my fear is that this name would be confusing for anyone familiar with UML 1.x’s collaboration diagrams which are now called communication diagrams. In this diagram the collaboration symbol contains a detailed composite structure diagram, showing how the composite structure diagrams can effectively be nested within one another.


Figure 2. Collaboration diagram for the enrolling in a seminar.

It is interesting to note that UML composite structure diagrams are very similar to object role model (ORM) diagrams in notation. Although the two diagrams explore similar issues, structure, they do so in different ways. ORM diagrams are very good for explored detailed relationships between entities whereas the focus of composite structure diagrams is on exploring collaborations between entities.

To be honest I don’t find composite structure diagrams to be of much use. I would much rather use UML sequence diagrams for exploring a collaboration because the notation is much more robust and because far more developers understand the notation.



This artifact description is excerpted from Chapter 11 of The Object Primer 3rd Edition: Agile Model Driven Development with UML 2.



The notation used in these diagrams, particularly the hand drawn ones, may not conform perfectly to the current version of the UML for one or more of reasons:

  • The notation may have evolved from when I originally developed the diagrams. The UML evolves over time, and I may not have kept the diagrams up to date.
  • I may have gotten it wrong in the first place. Although these diagrams were thoroughly reviewed for the book, and have been reviewed by thousands of people online since then, an error may have gotten past of us. We’re only human.
  • I may have chosen to apply the notation in “non-standard” ways. An agile modeler is more interested in created models which communicate effectively than in conforming to notation rules set by a committee.
  • It likely doesn’t matter anyway, because the modeling tool(s) that you’re using likely won’t fully support the current version of the UML notation perfectly anyway. Bottom line is that you’re going to be constrained by your tools anyway.

If you’re really concerned about the nuances of “official” UML notation then read the current version of the UML specification.