# UML Association

**In short:** A UML association is a solid line between two classes. It shows that objects of one class refer to objects of the other. Ends can carry role names, multiplicity and navigability arrows.

## Explanation

An association is a line in a UML class diagram (see UML Class Diagram). It connects two classes. It says that at least one of the two classes refers to the other.

**Drawing it**

A binary association is a solid line between two classes. A reflexive (self) association is a binary association that connects a class to itself.

**Names and role names**

The line may carry a name. Each end may carry a role name. Officially, a role name is the association end name. It indicates the attribute name used in code.

**Multiplicity**

An end may show a multiplicity such as `*` or `0..1`. Multiplicity states how many objects take part in the association. You read it from the perspective of the other end.

**Navigability**

An open arrowhead on one end documents that the class at that end can be reached efficiently. A cross on an end marks it as not navigable. A navigability arrow points from the source object to the target object.

**Association or attribute**

An association line and an attribute show the same relationship. They are semantically equal. The line gives more visual emphasis. Showing both is therefore redundant, so pick one.

## Example

A diagram has two classes, `Customer` and `Order`. A solid line joins them. The end at `Order` is labeled `orders` with multiplicity `*`. The end at `Customer` is labeled `buyer` with multiplicity `1`. An open arrow points to `Order`. The diagram says a customer can reach its orders. In code, `Customer` would hold an attribute named `orders`. The diagram does not also list `orders` inside the `Customer` box. That would show the same fact twice.

## Trade-offs

An association line gives a relationship visual weight. An attribute keeps the diagram compact. Both mean the same thing, so choose by how much emphasis the relationship deserves. Do not use both for the same relationship.

An association with a name, role names, multiplicities and a navigability arrow.

```plantuml
@startuml
class Customer
class Order
Customer "buyer 1" --> "orders *" Order : places
@enduml
```

## Checks

- Each relationship between two classes is shown either as an association line or as an attribute, not both.
- Association ends that matter carry a multiplicity such as * or 0..1.
- Role names on association ends match the attribute names used in code.
- Where reachability matters, navigability is shown with an open arrowhead or a cross.

## Related

- [UML Class Diagram](https://arc.fuet.ch/concepts/modeling-uml/class-diagram.md)
- [UML Class Diagram Relationship](https://arc.fuet.ch/concepts/modeling-uml/class-diagram-relationships.md)
- [Aggregation vs. Composition](https://arc.fuet.ch/concepts/modeling-uml/composition-versus-aggregation.md)
- [Common Class Diagram Modeling Mistakes](https://arc.fuet.ch/concepts/modeling-uml/common-class-diagram-modeling-mistakes.md)
- [Constraining Associations](https://arc.fuet.ch/concepts/domain-driven-design/entity-relationship-clarification.md)
- [UML Structure Diagram](https://arc.fuet.ch/concepts/modeling-uml/structure-diagram.md)
- [Unified Modeling Language (UML)](https://arc.fuet.ch/concepts/modeling-uml/uml-unified-modeling-language.md)
- [Domain Model](https://arc.fuet.ch/concepts/domain-driven-design/domain-model.md)

## Sources

- [Class diagram - Wikipedia](https://en.wikipedia.org/wiki/Class_diagram) — en.wikipedia.org, accessed 2026-11-09
- [16.4 Ways to Show UML Attributes: Attribute Text and Association Lines | Applying UML and Patterns: UML Class Diagrams | InformIT](https://www.informit.com/articles/article.aspx?p=1398623&seqNum=5) — informit.com, accessed 2026-11-09
