Browse OOP reference
Relationships and dispatch

What is aggregation?

On this page

Aggregation models a whole and its parts. UML’s hollow diamond denotes shared aggregation, whose precise semantics depend on the model. If a playlist references songs that exist independently and occur in other playlists, record those facts explicitly. An ordinary association with multiplicities may convey more.

Worked example

Python
track = {"id": "A", "title": "Overture"}
morning = [track]
evening = [track]
morning.clear()
assert evening[0] is track

OMG Unified Modeling Language specification

Explore class relationships in the OOP Playground

What is composition?What is association?What is the object-relational impedance mismatch?

All OOP questions

Search ObjectFAQ