Description
Constructs::DataType reuses the definition of DataType from Basic. It adds a specialization to Constructs::Classifier.
DataType defines a kind of classifier in which operations are all pure functions (i.e., they can return data values but they
cannot change data values, because they have no identity). For example, an "add" operation on a number with another
number as an argument yields a third number as a result; the target and argument are unchanged.
A DataType may also contain attributes to support the modeling of structured data types.
Attributes
No additional attributes.
Associations
Constraints
No additional constraints.
Semantics
A data type is a special kind of classifier, similar to a class, whose instances are values (not objects). For example, the
integers and strings are usually treated as values. A value does not have an identity, so two occurrences of the same value
cannot be differentiated. Usually, a data type is used for specification of the type of an attribute. An enumeration type is
a user-definable type comprising a finite number of values.
If a data type has attributes, then instances of that data type will contain attribute values matching the attributes.
Semantic Variation Points
Any restrictions on the capabilities of data types, such as constraining the types of their attributes, is a semantic variation
point.
Notation
A data type is denotated using the rectangle symbol with keyword «dataType» or, when it is referenced by e.g. an
attribute, denoted by a string containing the name of the data type.
Presentation Options
The attribute compartment is often suppressed, especially when a data type does not contain attributes. The operation
compartment may be suppressed. A separator line is not drawn for a missing compartment. If a compartment is
suppressed, no inference can be drawn about the presence or absence of elements in it. Compartment names can be used
to remove ambiguity, if necessary.
Additional compartments may be supplied to show other predefined or user-defined model properties (for example, to
show business rules, responsibilities, variations, events handled, exceptions raised, and so on). Most compartments are
simply lists of strings, although more complicated formats are also possible. Appearance of each compartment should
preferably be implicit based on its contents. Compartment names may be used, if needed.
A data-type symbol with a stereotype icon may be "collapsed" to show just the stereotype icon, with the name of the data
type either inside the rectangle or below the icon. Other contents of the data type are suppressed.
Style Guidelines
Examples