# Instance Specification

**In short:** An instance specification is a UML model element that stands for one instance in a modeled system. It gives a concrete example, with attribute values, of something a class describes in general.

## Explanation

An instance specification is a UML model element that represents an instance in a modeled system. An instance is one concrete thing, such as one particular customer. (See the article UML Class Diagram for how classes describe things in general.)

**Class versus instance.** A class, more generally called a classifier, describes a set of instances that share features. An instance specification identifies just one of them.

**Where it appears.** Object diagrams use instance specifications. Each object and link on such a diagram is modeled as one. An object diagram is a graph of instances, including objects and data values. It is more concrete than a class diagram.

**Names.** The name of the instance and the name of its classifier are both optional. An anonymous instance of an unnamed classifier is written as an underlined colon.

**Slots.** A slot corresponds to one attribute or feature. It may hold a value for that feature. Slots appear in a compartment beneath the instance name. Written as text, a slot is the feature name, an equal sign, and the value. For example: `status = open`.

**Why use them.** Object diagrams give examples for a class diagram or act as test cases for it. They make an abstract class model concrete.

## Example

A class diagram says that an Order has a status and a total. An object diagram adds one instance specification for a single order. Its slots read `status = open` and `total = 40`. A second, anonymous instance shows another order. A reviewer can now check that the class model fits realistic cases.

## Trade-offs

An instance specification shows one case, or a few. It does not replace the class model, which covers the whole set of instances.

A class and two instance specifications, one named and one anonymous.

```plantuml
@startuml
class Order {
  status : String
  total : Integer
}
object "o1 : Order" as o1 {
  status = open
  total = 40
}
object "anonymous : Order" as o2 {
  status = paid
}
o1 ..> Order : <<instantiate>>
o2 ..> Order : <<instantiate>>
@enduml
```

## Checks

- Object diagrams model each object and link as an instance specification.
- Object diagrams are used to give examples or test cases for the class diagram.
- Slots show feature values as a feature name, an equal sign and a value.

## Related

- [UML Class Diagram](https://arc.fuet.ch/concepts/modeling-uml/class-diagram.md)
- [Unified Modeling Language (UML)](https://arc.fuet.ch/concepts/modeling-uml/uml-unified-modeling-language.md)
- [UML Structure Diagram](https://arc.fuet.ch/concepts/modeling-uml/structure-diagram.md)
- [UML Modeling Best Practice](https://arc.fuet.ch/concepts/modeling-uml/uml-modeling-best-practice.md)
- [UML Class Diagram Relationship](https://arc.fuet.ch/concepts/modeling-uml/class-diagram-relationships.md)

## Sources

- [](https://site.uottawa.ca/~tcl/gradtheses/mnojoumian/ThesisFiles/FinalSpec/UML/7.3.22.html) — site.uottawa.ca, accessed 2026-11-09
- [Object diagram - Wikipedia](https://en.wikipedia.org/wiki/Object_diagram) — en.wikipedia.org, accessed 2026-11-09
- [From Aristotle to EA: a type theory for EA](https://grahamberrisford.com/AM%204%20System%20theory/DescriptionAndReality/TypesSetsAndVocabulary/UML%20types%20and%20instances.htm) — grahamberrisford.com, accessed 2026-11-09
