Closed venuslimm closed 1 year ago
@venuslimm delete cascading is a side effect of composition, not a sufficient condition for it.
Yes, a review cannot exist without a corresponding stock item, but conceptually, is a review part of a stock item? The answer may be subjective but it feels like reviews are entities in their own rights that get attached to stock items rather than being part of a stock item. Still, the decision for deciding if an association is actually a composition is not very clear cut.
Okay, thank you!
Hello, may I know why there isn't a composition between
StockItem -> Review
?StockItem
consists ofReview
. Also,Review
cannot exist withoutStockItem
, similar to howRating
cannot exist withoutReview
.Code:
Answer given: