nus-cs2103-AY1920S1 / forum

Forum
1 stars 1 forks source link

Questions on association classes #190

Closed KendrickAng closed 4 years ago

KendrickAng commented 4 years ago

In the mock practice paper (part II), the answer for 1a is given as follows:

image

Firstly, answer for question 1a uses a Trade class which is associated to two players and two collections of assets. Is this not just an alternative notation for association classes? In that case, could the association class be drawn as such:

image

Secondly, can association classes be additionally associated to other classes not part of the association (i.e associated to asset, beyond just between two players)?

Thirdly, for 1b: are we allowed to draw dependencies in an object diagram? I attempted to replicate the association class drawn above in object diagram form, but I’m not sure of its correctness:

image

Fourthly, can we use multiplicities in object diagrams instead of drawing associations to two objects of the same class:

image image

Thank you!