Open Li-Zizhen opened 5 months ago
in the class diagram, there is no association between chair and table class. If they had left out attribute in chair, there needs to be a line between the 2 classes.
As the object diagram shows there is an associaiton, this class diagram in c is not compliant.
@jannaleong Thank you for your response. So if we omit the attribute, we much show the association line instead?
I don't think that's the main focus. In the Class Diagram you highlighted, there is no association line being drawn between Chair and Table, hence there should be no associations between Chair and Table. This means that the object diagram is incorrect (because it IS showing an association between the Chair and Table)
Sorry for that.
Showing attributes is the same as the association line. Therefore, we can use attributes instead of association lines. However, attributes can also be omitted.
Therefore, if we use attributes instead of the association line and then omit that attribute(consider it as not important), we can just not show it right?
I suppose that's true, but since this question seems to be specific to the object diagram given, where it was deemed important to have that association between Chair and Table, c is less likely to be a correct option.
I suppose that's true, but since this question seems to be specific to the object diagram given, where it was deemed important to have that association between Chair and Table, c is less likely to be a correct option.
Yup, if it was relevant to the answer, it wouldn't have been omitted as 'not important'.
Why is C wrong? The attribute in
chair
is optional, it can choose not to show its attributetable
.