does one usually put aggregating associations between interfaces?
Example:
Here, I feel that one aggregation is redundant. The one between the interfaces is more important, because that's what the clients of the classes will be using. BMW and LuxuryWheel will always be used through ICar and IWheel. However, ICar does not really aggregate IWheel, as it is an interface and contains no actual logic. BMW does clearly aggregate LuxuryWheel but that is almost an implementation detail.
How would you model this? Is there a way in UML to mark an aggregation (or association) as abstract, or to-be-implemented?
In UML models, an aggregation relationship shows a classifier as a part of or subordinate to another classifier. An aggregation is a special type of association in which objects are assembled or configured together to create a more complex object.
Aggregation relationship is represented by a straight line with an empty diamond at one end. The composition relationship is represented by a straight line with a black diamond at one end. In UML, it can exist between two or more classes.
Link aggregation (IEEE 802.3ad) enables you to bind two or more physical interfaces together to form an aggregated (combined) link. This new link has the bandwidth of all the links combined.
In UML modeling, interfaces are model elements that define sets of operations that other model elements, such as classes, or components must implement. An implementing model element realizes an interface by overriding each of the operations that the interface declares.
If you look at the UML spec, you'll find that in 7.3.24:
In particular, an association between interfaces implies that a conforming association must exist between implementations of the interfaces.
So, yes, you can draw aggregations between interfaces, but your diagram may not exactly mean what you expect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With