5

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?

8

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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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