nus-cs2103-AY2021S1 / forum

20 stars 2 forks source link

Object Diagram #514

Closed richardcom closed 3 years ago

richardcom commented 3 years ago

Dear Prof and TAs, in one of the exercises, we were asked to draw the object diagram. However, as shown from the question and previous class diagram, Task must have one Repeatable owner. Though we cannot show interface or abstract class concepts in object diagram, I wonder shall we use ActionX or other concrete class Actions as a owner here or is it okay to neglect the interface attribute Repeatable owner even though the multiplicity is 1.

image

image

damithc commented 3 years ago

Good catch. In this question, the object diagram will have to be considered 'partial' (we can't add an owner because we have not been told who the owner is). Although not required (i.e., not required with respect to grading), you can add a Repeatable object as the owner. Yes, an interface can be used as the type of an object if we don't care to show the actual concrete type.

richardcom commented 3 years ago

Thanks a lot Prof! Thus, does it mean that we can also draw abstract class / interface object in the Object diagram as well?