Search code examples
javaumldiagramclass-diagram

UML Class Diagram - Multiple Associations


an UML class diagram that pictures an high school administration system is required.

  • Pupils and Teachers derive from Person
  • each Pupil belongs to 1 (School)Class
  • each class has btw 10-25 students
  • each Teacher has >= 1 Certificate to teach a (School)Subject

[Draft of Elements]

further, it is asked to design the following:

a) which Teacher, teaches which Class, in which Subject, for how many hours/week?
b) is there a safe way to assure that a Teacher only teaches Subjects he has a Certificate for?

after fuzzing around several hours i came up with this: [Complete Draft].

but i still can not imagine how to design the diagram in a way that all (or at least three) of the conditions from a) are presented as required.

is there actually a way to do so in a UML class diagram?

edit: after reading Ayo Ks comment i came up with this: img


Solution

  • I would use an association class with a constraint.

    enter image description here