Multiplicity of Comment in Element

33 views
Skip to first unread message

Robert Hairgrove

unread,
Mar 15, 2024, 7:19:55 AMMar 15
to UML Forum
According to the diagram on page 63 of the UML 2.5.1 standard (Figure 7.1 "Root"), an Element can own zero or exactly one Comment. However, in the paragraph 7.2.3.2 on the following page, there is talk about "ownedComments". This seems to contradict the multiplicity given in the diagram, which is singular.

Another thing about Comment is that its "body" attribute can be an empty string, again according to the diagram. Does it make sense for any Element to have a comment whose body is empty, as opposed to merely lacking a comment entirely?

Robert Hairgrove

unread,
Mar 31, 2024, 10:39:33 AMMar 31
to UML Forum
OK, I misread the multiplicity of Comment WRT Element (took the wrong association end). So it is "zero or more".

But Comment is not abstract, nor is it a named element, so it is not clear to me how one should access a specific Comment except by index into a vector or some other suitable container. I suppose one could still derive a named element from Comment and use that as an identifier?
Reply all
Reply to author
Forward
0 new messages