nus-cs2103-AY2021S2 / forum

10 stars 0 forks source link

Luminus quiz 3 question 8 #368

Open prerthan99 opened 3 years ago

prerthan99 commented 3 years ago

Hi, I was just wondering why the answer isnt the first one? shouldn't there be a constructor for client and why is server higher than client i.e. why is server instantiated before client? thanks

Screenshot 2021-04-23 at 11 05 54 PM

kouyk commented 3 years ago

Server is provided as an argument to the constructor of Client, so under normal circumstances Server should have been instantiated before Client. Thus Server is higher than Client since it is a partial diagram and the caller that instantiate the Client is outside of the diagram captured.