A composition relationship makes one object’s life cycle depend on another. If the composing object dies, its composed object dies with it. That is the practical question behind the UML diamond: can these objects live independently, or is one owned by the other? section 1.1.2
Library ownership
A Library and its Catalog form a one-to-one composition: destroying the Library also destroys its Catalog. A Library and its Members form a one-to-many composition: all Member objects share the Library’s life cycle. By contrast, Book and Author form a many-to-many association because books and authors can continue to exist independently. section 1.1.2
When composition becomes data rather than an object diagram, make the relation explicit:
- Represent one-to-many ownership through the composing entity and its collection of composed entities. section 3.1
- Distinguish composition from association by modeling whether entities share a life cycle or retain independent identities. section 1.1.2
- Represent related entities explicitly with identifiers and collections; for example, a Catalog can hold an index for retrieving Books. section 3.1
Figure 1.2 The two kinds of composition: one-to-one and one-to-many. In both cases, when an object dies, the composed object dies with it.
Compare the one-to-one and one-to-many forms of composition and their shared lifecycle rule. section 1.1.2

