Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper way to put array in UML diagram? [duplicate]

I am new to UML diagrams, so this may be a very ignorant question though I can't find the answer anywhere.

There is a class Classroom that holds an object of lecture times. Should lecture times be its own class or should it be an attribute of Classroom?

Feel free to critique notation.

Edit: I have already seen this post and it has not helped. I would like to know if LectureTime should be a separate class.

Option 1: Option 1

Option 2:

Option 2

like image 365
Peter Tao Avatar asked Oct 24 '25 18:10

Peter Tao


1 Answers

You create a new class if it has more than a single attribute and/or additional operations (which are not just a getter/setter). Or of you plan to add them in a later phase.

In your case lectureTime is obviously a simple type and the 2nd variant is to be preferred, except see above.

However, instead of the round braces you should use square brackets like validLectureTimes[] or validLectureTimes[0..*] which are equivalent.

like image 138
qwerty_so Avatar answered Oct 26 '25 18:10

qwerty_so