XCSG:TypeAlias
An AliasType introduces a synonym for an existing type analogous to the use of typedef in C++.
The semantics of AliasType are those common to the UML Meta-Object Facility (MOF) definition of AliasType and the C++ definition of typedef.
An AliasType does not introduce a new type, but provides a synonym (alias) for a given type, the referenced type. This type may be an existing type. or an instantiation of a type with template parameters.
An AliasType may appear anywhere the referenced type may appear.
The semantics of the model are unchanged if all occurences of an AliasType are replaced by occurences of the referenced type.
An AliasType is similar to a subtype of a UML Class or Datatype. AliaasTypes differ from subtypes, however, in that a) they cannot extend their parent classifier definition, and b) if more than one alias is created for a type, they are treated as the same type with regard to assignment and type compatibility.
In this regard, the use of subtypes is generally preferable since subtypes can be extended to include new attributes and operations, and since they are strongly typed (are not treated as the same type, but as distinct types, with explicit conversions between them).
Specification
Metaclass | TypeAlias |
---|---|
Extends | Type |
Description | An alias for an existing type. |
Direct Subkinds | C:Enum |
---|
All Superkinds | Node, ModelElement |
---|
Specified In Edges | |||
---|---|---|---|
In Edge | Predecessor | Multiplicity | Description |
AliasedType | TypeAlias | ✱ | Connects a TypeAlias to the Type or TypeAlias it was declared to duplicate. |
DefinedAs | Variable | ✱ | Connects a Variable or DataFlow node which received its Type via a TypeAlias (such as a C/C++ typedef) to that TypeAlias. |
DataFlow (Node) | ✱ |
Specified Out Edges | |||
---|---|---|---|
Out Edge | Successor | Multiplicity | Description |
AliasedType | Type | 0..1 | Connects a TypeAlias to the Type or TypeAlias it was declared to duplicate. |
TypeAlias | 0..1 |
Known Possible In Edges
| ||||
---|---|---|---|---|
Inherited From | In Edge | Predecessor | Multiplicity | Description |
Node | Contains | Node | 1 | Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge. |
Known Possible Out Edges
| ||||
---|---|---|---|---|
Inherited From | Out Edge | Successor | Multiplicity | Description |
Node | Contains | Node | ✱ | Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge. |
Language mappings
AliasType maps to typedef in C++.