Data types

In UML diagrams, data types are model elements that define data values. You typically use data types to represent primitive types, such as integer or string types, and enumerations, such as user-defined data types.

A data type is similar to a class; however, instances of data type are identified only by their value. If two data types have the same value, the instances are considered identical.

A data type can contain attributes, but only to support the modeling of structured data types. Instances of structured data types are considered the same if the following conditions are true:

By default, when you create a new data type, the compartments for attributes and operations are hidden.

As the following figure illustrates, a data type artifact is displayed as a rectangle that contains the name of the data type. The rectangle also contains the stereotype «data type» and the data type icon.

A rectangle displays the name DataType1, the word dataType in double angle brackets, and the corresponding icon.


Feedback