Search code examples
umlaggregationentity-relationshipmodeling

Which relationship in Entity-Relationship (ER) models is equivalent to aggregation in UML?


I'm very puzzled about how to express the concept of 'aggregation' from UML in Entity-Relationship (ER) models. Although the Extended ER (EER) model provides the concept of aggregation, it seems to primarily describe the 'relationship between relationships', which is different from the 'whole-part' aggregation in UML.

On the other hand, while UML's aggregation expresses a whole-part relationship, which makes it similar to the one-to-many relationship in ER, the 'part' in a UML aggregation relationship can belong to multiple 'wholes'. This makes the relationship seem more like a many-to-many relationship.

So, how should I express the concept of aggregation from UML, with ER model?

Or, should it depends?


Solution

  • In UML there are two aggregagations:

    • shared aggregation (white diamond): the UML specifications do not define any semantic for it. It's allost for 20 years that UML does not define shared aggregation as a part whole relationship! As there is no real difference between shared aggregation and ordinary association, it's recommended to prefer the simpler association. You would therefore model it in ERD as well as a simple relationship.

    • composite aggregation (black diamond, also known as "composition"): in UML this means ownership of the component by the composite. In ERD using Chen notation you would in most of the cases represent the component as a weak entity, and the composite aggregation as a weak relationship (some authors call it strong relationship, and I'm always in doubt, but in any case, it's a double line around the relationship diamond).

      This is however accurate only if the multiplicity on the UML composite side (the owner) is 1, because the weak entity cannot exist without its owner. In the cases the multiplicity was 0..1, the component could exist on its own, without composite. This can only be represented in ERD with a normal association that you would name as admiraalit suggested.

    Note that in Crow's foot ERD notation, there is in no way to distinguish weak and strong relationships, except for notation variants that use plain and dashed lines. Weak entities could be identified with the definition of the composite primary key.