nus-cs2103-AY2223S2 / forum

12 stars 0 forks source link

How to have separate classes Instructor and Coordinator for the first screenshot? #258

Open kyueran opened 1 year ago

kyueran commented 1 year ago
Screenshot 2023-03-15 at 9 27 46 AM Screenshot 2023-03-15 at 9 27 52 AM

May I ask in the first screenshot it says there can be a solution with a separate Instructor and Coordinator class. But from the second screenshot it shows that if we have two separate classes we face the problem of having duplicate person as a coordinator and instructor (Tom in this case) which is not allowed. How can we have a solution with separate Instructor and Coordinator classes while avoiding this problem?

damithc commented 1 year ago

How can we have a solution with separate Instructor and Coordinator classes while avoiding this problem?

Good question @kyueran The answer will be given during this week's lecture. Hint: we use the Person class to represent the actual person (i.e., only one object per person) and Instructor, Coordinator classes to represent the roles played by that person (i.e., one object for each module taught by that person).