Question

In my UML class diagrams I usually do object collections by placing the attribute name above the arrow that relates both classes (as opposed to the other notation that just adds the attribute with brackets indicating the multiplicity). But I have cases in which there are more than one collection of the same kind of object. For example (a very simple example off the top of my head): simple aggregation diagram

Let's say there is a course that has some students who applied for it (so I have a collection of students, let's say an attribute that is an ArrayList of Student, called "applied"). But also, I need to keep a separate collection of the students who actually attended the course (let's say, "attended": another attribute that is an ArrayList, or even a different collection type, like a Vector, of Student).

Should I just add all attribute names on the relationship line?

I'm looking to do this the standard UML way. Only clarifying this because I know UML rules can be flexible when we need them to.

Was it helpful?

Solution

UML does allow for multiple associations between classes using roles. You would simply draw two arrows: enter image description here

See here for a similar question where the diagram is taken from.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top