Uniqueness Constraints

Let’s learn about uniqueness constraints and standard identifiers.

A uniqueness constraint (or key constraint) requires that a property’s value—or the value list of a list of properties in the case of a composite key constraint—is unique among all instances of the given object type.

Uniqueness constraints in UML

For instance, in a UML class diagram with the object type Book, we can define the isbn attribute to be unique (or a key) by appending the user-defined property modifier keyword key in curly braces to the attribute’s definition in the Book class rectangle. This is shown in the following diagram:

Get hands-on with 1200+ tech skills courses.