Open Li-Zizhen opened 2 months ago
To show multiplicity for lists u can put the number of possible objects in the list so like 0..*
To show multiplicity for lists u can put the number of possible objects in the list so like 0..*
Technically, you can. There is an example is the UML reference sheet.
But we have never used this notation anywhere else is in course; so, will not be examined.
If the array list is treated as a single instance, how do we show the multiplicity in class diagram?
@Li-Zizhen Data structures such as lists are not shown in class/object diagrams because their main purpose is give us the ability to keep more than one object. So, a multiplicity such as *
or 0..5
in a class diagram already indicates the use of some kind of 'collective' data structure, without needing to show the data structure as a separate class.
In an object diagram, just omit the list object and simply connect to the objects inside the list.
Moreover, since the implementation of UiWidget is not given in the questions, how do we know if it contains reference to activities? Making this two-way arrows instead of single arrow?
Just show what is known. Code not given means the code is not relevant to the answer :-)
If the array list is treated as a single instance, how do we show the multiplicity in class diagram?![image](https://github.com/nus-cs2103-AY2324S2/forum/assets/122284239/b03ad0d6-b563-4b03-af38-f5a48d521307)
Moreover, since the implementation of UiWidget is not given in the questions, how do we know if it contains reference to activities? Making this two-way arrows instead of single arrow?![image](https://github.com/nus-cs2103-AY2324S2/forum/assets/122284239/ca93f3fc-194b-4382-8416-74d4eaab4a9c)