Closed justgnohUG closed 3 years ago
Yes, you can. That said, do note that we recommend not to use aggregation at all, in class or object diagrams. Aggregation doesn't add much value; it's just noise.
Thank you for the reply Prof @damithc,
That said, I would think most of the time in the Exam especially, aggregation can be substituted for other forms of association, and a need for aggregation would be close to unnecessary?
Not trying to sniff out Exam questions, but more curious of the situations we would ever be "forced" to utilize aggregation.
In the exam, we do not expect you to use aggregation symbol when drawing class/object diagrams. However, you should still be able to interpret the aggregation symbol in a given diagram.
From these 2 code blocks in Week 8 Tutorial,
(
Stock Item
code block is included for relevancy)Alternatively, visit https://nus-cs2103-ay2021s2.github.io/website/schedule/week8/tutorial.html for full context.
The Actual Question I would like to clarify the relationship between
Item
andInventory
.Given that
Inventory
has aList<Item>
reference, I was wondering if Aggregation is possible here in the Object DiagramPS: Diagram updated as aggregation direction was incorrect initially.