Aggregation
A line with a hollow (white) diamond at one end is aggregation: a whole-part relationship in a UML class diagram. The diamond sits against the class that is the whole.
Easily confused with
How to read it
The hollow diamond marks shared aggregation. The class at the diamond end is the whole, the aggregate, and the class at the plain end is the part. Robert C. Martin's example is a Window that contains many Shapes. UML 2.5.1 describes aggregation as one instance grouping together a set of others, and then leaves its meaning open: "Precise semantics of shared aggregation varies by application area and modeler." Course notes give the usual reading, that the parts can exist without the whole and may be shared. Kansas State University's textbook compares it to a shopping cart: the groceries existed before they went into the cart and still exist after they come out. Virginia Tech's OpenDSA notes have a department with an aggregation of professors, any of whom could work in more than one department.
Also searched as: aggregation symbol, hollow diamond uml, uml aggregation.
Aggregation or composition?
The two diamonds differ in fill, and in how much the standard says about them. A filled diamond is Composition, and UML 2.5.1 gives it firm rules: a part belongs to at most one composite at a time, and is deleted along with it. For the hollow diamond the specification gives no rule at all.
Martin Fowler wrote in 2003 that aggregation has no semantics beyond those of a regular Association, and quoted James Rumbaugh, one of UML's three original authors, calling it "a modeling placebo". Fowler's advice to anyone who meets one is to ask what the diagram's author meant by it. Robert C. Martin went further in 1997, suggesting the relationship could be ignored altogether, and quoted the UML 0.8 document: "if you don't understand [aggregation] don't use it." What a hollow diamond does say, in Martin's words, is that the class it touches is "in some way the whole" and the other class is somehow part of it.
Which end the diamond goes on
The diamond touches the whole. UML 2.5.1 adds it at the end of the line away from the part, and asks for it to be noticeably smaller than the large diamond used for an association between three or more classes. Kansas State's textbook describes it as a diamond "fletching" at the aggregating class's end, with an optional arrowhead at the part's end. A number at the part's end is a Multiplicity: Martin marks the Shape end of his example with *, for many shapes.
Look-alikes
Diamonds standing on their own, not at the end of a line, are other symbols: a Decision and merge node in an activity diagram, a decision on a flowchart, or a relationship in a Chen ER diagram.
Read next
- Next in UML diagram symbolsCompositionA 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.
- 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); 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), Aggregation / Association
- UML (CIS 400 Textbook: Object-Oriented Design, Implementation, and Testing), Chapter 5, UML, Kansas State University, Department of Computer Science, Aggregation
- The Unified Modeling Language (OpenDSA Complete Catalog, 3.2), Chapter 3, Object-Oriented Programming, OpenDSA Project, Virginia Tech, 3.2.1.2 Class Diagrams, Aggregation
- 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), Slide 22
Researched, edited and approved by Rory Hansen before publishing. Last reviewed October 9, 2026. How we research
Added .