Kernel ­ the DataTypes Diagram


The DataTypes diagram of the Kernel package is shown in Figure 40.

In order to locate the metaclasses that are referenced from this diagram,
· See "Classifier (from Kernel, Dependencies, PowerTypes)" .
· See "InstanceSpecification (from Kernel)".
· See "Property (from Kernel, AssociationClasses)" .
· See "Operation (from Kernel)" .

DataType (from Kernel)

A data type is a type whose values have no identity (i.e., they are pure values). Data types include primitive built-in types (such as integer and string) as well as enumeration types.

Description

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
ownedAttribute: Attribute[*]           The Attributes owned by the DataType. Subsets Classifier::attribute and Element::ownedMember.
ownedOperation: Operation[*]       The Operations owned by the DataType. Subsets Classifier::feature and Element::ownedMember.

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

· Center the name of the data type in boldface.
· Center keyword (including stereotype names) in plain face within guillemets above data-type name.
· For those languages that distinguish between uppercase and lowercase characters, capitalize names (i.e, begin them with an uppercase character).
· Left justify attributes and operations in plain face.
· Begin attribute and operation names with a lowercase letter.
· Show full attributes and operations when needed and suppress them in other contexts or references

Examples


Enumeration (from Kernel)

An enumeration is a data type whose values are enumerated in the model as enumeration literals.

Description

Enumeration is a kind of data type, whose instances may be any of a number of user-defined enumeration literals.
It is possible to extend the set of applicable enumeration literals in other packages or profiles.

Attributes

No additional attributes.

Associations

Constraints

No additional constraints.

Semantics

The run-time instances of an Enumeration are data values. Each such value corresponds to exactly one EnumerationLiteral.

Notation

An enumeration may be shown using the classifier notation (a rectangle) with the keyword «enumeration». The name of the enumeration is placed in the upper compartment. A compartment listing the attributes for the enumeration is placed below the name compartment. A compartment listing the operations for the enumeration is placed below the attribute compartment. A list of enumeration literals may be placed, one to a line, in the bottom compartment. The attributes and operations compartments may be suppressed, and typically are suppressed if they would be empty.

Examples



EnumerationLiteral (from Kernel)

An enumeration literal is a user-defined data value for an enumeration.

Description

An enumeration literal is a user-defined data value for an enumeration.

Attributes

No additional attributes.

Associations

enumeration: Enumeration[0..1]    The Enumeration that this EnumerationLiteral is a member of. Subsets NamedElement::namespace.

Constraints

No additional constraints.

Semantics

An EnumerationLiteral defines an element of the run-time extension of an enumeration data type.

An EnumerationLiteral has a name that can be used to identify it within its enumeration datatype. The enumeration literal name is scoped within and must be unique within its enumeration. Enumeration literal names are not global and must be qualified for general use.

The run-time values corresponding to enumeration literals can be compared for equality.

Notation

An EnumerationLiteral is typically shown as a name, one to a line, in the a compartment of the enumeration notation.

PrimitiveType (from Kernel)


A primitive type defines a predefined data type, without any relevant substructure (i.e. it has no parts). A primitive datatype may have an algebra and operations defined outside of UML, for example, mathematically.

Description

The instances of primitive type used in UML itself include Boolean, Integer, UnlimitedNatural, and String.

Attributes

No addtional attributes.

Associations

No additional associations.

Constraints

No additional constraints.

Semantics

The run-time instances of a primitive type are data values. The values are in many-to-one correspondence to mathematical elements defined outside of UML (for example, the various integers).

Instances of primitive types do not have identity. If two instances have the same representation, then they are indistinguishable.

Notation

A primitive type has the keyword «primitive» above or before the name of the primitive type.

Instances of the predefined primitive types may be denoted with the same notation as provided for references to such instances (see the subtypes of "ValueSpecification (from Kernel)").