Note: this question is different from Can a UML class diagram show two different relationships between two classes? which is about two relations of different type.
I have a Menu
class which contains:
A bunch of children, which are instances of
MenuItem
class.An instance of a
MenuItem
class which corresponds to a very specific menu item (and is not necessarily set for every instance ofMenu
class.)
How am I expected to represent such relation? In other words, is this representation correct:
or should I remove the second aggregation as being redundant?
MenuItem
's lifecycle is tightly bound toMenu
's. Why not use compositions instead of "simple" aggregations