Open ZhangAnli opened 3 years ago
Thanks for sharing!
PS: Just my 2 cents :)
To add to what @tlylt has mentioned,
I think it's possible for StockItem to have a composition to Review (since it seems unlikely that a review would exist without an item)
My attempt:
To add to what @tlylt has mentioned,
I think it's possible for StockItem to have a composition to Review (since it seems unlikely that a review would exist without an item)
My attempt:
Btw your double arrow from Inventory to Item is wrong. If there is a stronger association indicated by the solid line, there is no need to include a dependency line anymore
StockItem to Review, I used 0..1 instead as I feel that it might be possible if null is passed in
Even if null is passed in, a Review object will still be created, so it should be just 1.
Btw your double arrow from Inventory to Item is wrong. If there is a stronger association indicated by the solid line, there is no need to include a dependency line anymore
Oops forgot to erase it
StockItem to Review, I used 0..1 instead as I feel that it might be possible if null is passed in
Even if null is passed in, a Review object will still be created, so it should be just 1.
@kouyk True, I think in this case StockItem to Review has to be 1. I think for Review to Rating, it could still be 0..1?Unless it does not matter if it is null or not
StockItem to Review, I used 0..1 instead as I feel that it might be possible if null is passed in
Even if null is passed in, a Review object will still be created, so it should be just 1.
@kouyk True, I think in this case StockItem to Review has to be 1. I think for Review to Rating, it could still be 0..1
Review to rating should also be 1, since the code indicates that there is a Rating inside review. I don't think null matters in this case. Maybe @damithc can clarify more?
If Review class is simply like above, we all agree that it could be 0..1, So either it means that if a variable is never explicitly initialized we can treat it as 0..1 or it means that if a variable could be assigned null, then we treat it as 0..1 That's my interpretation, will be good if prof clarifies
Review to rating should also be 1, since the code indicates that there is a Rating inside review. I don't think null matters in this case. Maybe @damithc can clarify more?
Wasn't this entire question discussed during tutorial 8? You may want to watch the week 8 tutorial recording. :-p
Review to rating should also be 1, since the code indicates that there is a Rating inside review. I don't think null matters in this case. Maybe @damithc can clarify more?
Wasn't this entire question discussed during tutorial 8? You may want to watch the week 8 tutorial recording. :-p
Are tutorial recordings available for students to view? Doesn't seem to be able to find them.
Are tutorial recordings available for students to view? Doesn't seem to be able to find them.
In the MS Team for your tutorial group, there is a file called Recordings.docx
that should contain all the tutorial recordings. If not found, ask the tutor to update it.
As the exam is tomorrow, here's the recording from my T8.
Access Passcode: cs2103-tutorial
According to the tut, 0..1 is fine for variables (40:00 mins) prof mentions this.
here's my attempt. ive fixed some of the 'bugs' but i think its pretty similar
actually, I do think that from StockItem to Rating there should be 1 because it's in the constructor. Im not sure if we can pass in null instead of the enums in a constructor without causing an error. if it is possible to pass null then I guess 0..1 is valid but if we cant pass in null, id say it should be 1
Are tutorial recordings available for students to view? Doesn't seem to be able to find them.
In the MS Team for your tutorial group, there is a file called
Recordings.docx
that should contain all the tutorial recordings. If not found, ask the tutor to update it.As the exam is tomorrow, here's the recording from my T8.
Access Passcode: cs2103-tutorial
is the audio working or is it just my issue?
actually, I do think that from StockItem to Rating there should be 1 because it's in the constructor.
Isn't StockItem to Rating a dependency? Where does the multiplicity come in?
Im not sure if we can pass in null instead of the enums in a constructor without causing an error.
Enums can be set to null, it is the responsibility of the relevant code to verify that it is not null to ensure correctness.
is the audio working or is it just my issue?
It does appear that the issue is on your side, the audio works for me.
Hello! Here are my answers for this PYP. Please feel free to let me know what my mistakes are!