Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.