nus-cs2103-AY2425S1 / forum

11 stars 0 forks source link

Question about association #896

Open Feng1231 opened 1 day ago

Feng1231 commented 1 day ago

In this diagram, I believe that it is quite clear that there should be a bidirectional association r/s btw action and task. However, why is it represented by two unidirectional arrows (one from task to repeatable, one from action to task)? I thought representing it using two unidirectional arrows in this case is not correct. image

From course material: image

cth06-Github commented 22 hours ago
image

I think the reason is because there is no (direct) association from Task to Action. From the image I screenshot, the code Repeatable owner in Task class indicates that there is an association from Task to Repeatable, thus there is an arrow drawn from Task to Repeatable in the class diagram. No where else in the code for Task class suggests that there is an association from Task to Action.

We can infer that there is an association from Action to Task due to the code List<Task> tasks in the Action class.

damithc commented 10 hours ago

@cth06-Github's explanation is correct 👍