Design – How to express recursive composition in UML class diagrams

designmodelinguml

I have one class called "Institution" which represents a public institution (with properties like id_inst, name_inst, tel_inst, fax_inst…). The institution can have affiliated institutions, for example a university is composed of different faculties (which are also institutions with the same properties and methods). Theses faculties can also have affiliated institutions : laboratories, annexes, etc.

How can I express this concept in a UML class diagram?

Best Answer

Recursive composition (or aggregation) is simply the composition or aggregation arrow looped back to the individual class. You can use the multiplicity notation to indicate any "can have" or "must have" relationships.

Figure 8 of Scott Ambler's tutorial on class diagrams provides an image of this.