Composition
A line with a filled (black) diamond at one end is composition: the strong whole-part relationship in a UML class diagram. Each part belongs to one whole at a time, and is deleted when the whole is.
Easily confused with
How to read it
The filled diamond sits against the composite, the whole, and the plain end of the line goes to the part. UML 2.5.1 calls composite aggregation "a strong form of aggregation": a part object can be included in at most one composite object at a time, and if a composite object is deleted, the part objects in it are deleted with it. A part can be removed from the composite before that happens, and then it isn't deleted with it. Robert C. Martin's example is a Circle composed of a Point, its centre, whose lifetime depends on the Circle's. Course notes use a car that owns its engine (Virginia Tech's OpenDSA) and a dog made up of a tongue, ears, legs and a tail (Kansas State University's CIS 400 textbook).
Also searched as: composition symbol, composition vs aggregation, filled diamond uml, uml composition.
Composition or aggregation?
The fill is the only visual difference from the hollow Aggregation diamond. The meaning differs more: UML 2.5.1 gives composition two rules, one owner at a time and deletion with the whole, and gives aggregation none. Martin Fowler named the one-owner rule as the main thing composition adds: windows and panels might both hold menu bars, but each menu bar is held by only one whole. The University of Washington's software engineering course uses a cinema: if the cinema goes, so does its box office (composition), but the films it showed still exist (aggregation).
What the standard leaves open
The specification says the precise lifecycle semantics of composite aggregation is intentionally not specified, and neither is the order in which the parts are created. It does fix the Multiplicity at the composite's end: its upper bound can't be more than 1, since a part can't belong to two wholes.
Look-alikes
A small filled dot where an association line meets a class is not a diamond. It shows which class owns that end of the association, and the specification limits it to half the diamond's height so the two aren't mistaken for each other. A large diamond with three or more lines is an Association between three or more classes.
Read next
- Next in UML diagram symbolsGeneralization (inheritance)A solid line ending in a hollow triangle is generalization, UML's inheritance arrow. The triangle points at the more general class (the parent); the class at the other end is the more specific one (the subclass).
- The same shape in European flagsFlag of BelarusBelarus’s flag is red over green, the red two thirds of its height, with a red national ornament on white in a band by the pole. A Belarusian government notice for the Day of State Symbols in 2023 says the red is the courage of a people who defended their freedom with their blood, the green life and hope and the country’s forests and fields, and the white band with its ornament purity and spirituality.
More UML diagram symbols
The same shape elsewhere
Browse symbols drawn with diamonds, lines or squares and rectangles.
Sources
- OMG Unified Modeling Language (OMG UML), Version 2.5.1, OMG document formal/17-12-05, December 2017, Object Management Group, 9.5.3 Semantics (AggregationKind); 9.9.17 Property, constraints; 11.5.4 Notation
- AggregationAndComposition, Martin Fowler, 17 May 2003, martinfowler.com
- UML Tutorial: Part 1 -- Class Diagrams, Robert C. Martin, 1997, Northeastern University, Khoury College of Computer Sciences (course reading, CS U370, Fall 2007), Composition Relationships
- UML (CIS 400 Textbook: Object-Oriented Design, Implementation, and Testing), Chapter 5, UML, Kansas State University, Department of Computer Science, Composition
- The Unified Modeling Language (OpenDSA Complete Catalog, 3.2), Chapter 3, Object-Oriented Programming, OpenDSA Project, Virginia Tech, 3.2.1.2 Class Diagrams, Composition
- UML Class Diagrams (CSE 403 lecture slides), Emina Torlak, CSE 403: Software Engineering, Fall 2016, University of Washington, Paul G. Allen School of Computer Science & Engineering (Internet Archive), Slides 22–23
Researched, edited and approved by Rory Hansen before publishing. Last reviewed October 9, 2026. How we research
Added .