nus-cs2103-AY2324S2 / forum

16 stars 0 forks source link

Association in class diagrams #1031

Closed cheahTJ closed 6 months ago

cheahTJ commented 6 months ago

Hi, I have the following questions:

1.The explanation given is b. [incorrect] The navigability is not bi-directional as only one class keeps track of this association. So does it mean that I can draw an association with (start of arrow) at Bot and the (end of arrow) at Mat as well?

Screenshot 2024-04-26 at 12 37 16 PM

sethteo commented 6 months ago

I think its because this question is explicitly asking about the highlighted attribute helpers

If we think about the navigability of helpers, Mat would have a reference to Bot but the same reference is not present for Bot so it cant be Mat <--- Bot. I think due to the extra associations which are not highlighted it made it seem like there were bidirectionals or extra unidirectionals present.

I think for the diagram questions is more of true till proven false so if a diagram does not contradict the code exactly (like option a) it can be taken as correct

damithc commented 6 months ago

I think its because this question is explicitly asking about the highlighted attribute helpers

Yup.

On the more general question of bidirectional vs unidirectional, relevant comment https://github.com/nus-cs2103-AY2324S2/forum/issues/1003#issuecomment-2078623835

cheahTJ commented 6 months ago

Yupp i have misunderstood the question but yup i got it now thank you!