Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
How is that different from the Composite Design Pattern like in here? link – yossben May 2 '12 at 19:42
Actually, I want to build a tree with root "All institutions". How can I represent that hierarchy where all institutions are treated the same way? (no special treatment for leaves). – yossben May 2 '12 at 20:06
@yossben It's not different than the Composite pattern. As far as building the tree with a particular instance of a root, that's not appropriate for a class diagram - consider an object diagram. – Thomas Owens May 3 '12 at 12:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.