Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interface Aggregation in UML Class Diagrams

does one usually put aggregating associations between interfaces?

Example:

Example Diagram

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?

like image 698
TheFogger Avatar asked Mar 14 '11 10:03

TheFogger


People also ask

What is aggregation in UML class diagram?

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.

How do you show aggregation in UML class diagram?

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.

What is interface aggregation?

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.

WHAT IS interface in UML class diagram?

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.


1 Answers

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.

like image 87
Volker Stolz Avatar answered Sep 30 '22 02:09

Volker Stolz