Difference between revisions of "XCSG:Field"
Line 50: | Line 50: | ||
==Language mappings== | ==Language mappings== | ||
Field maps to the concept of a field in Java, and to the concept of a data member in C++. Fields may hold either data values (attributes) or pointers to other entities (which represent the ends of an association). | Field maps to the concept of a field in Java, and to the concept of a data member in C++. Fields may hold either data values (attributes) or pointers to other entities (which represent the ends of an association). | ||
+ | |||
+ | == See Also == | ||
+ | * [[:Category:XCSG Node Kinds]] | ||
+ | * [[:Category:XCSG Edge Kinds]] | ||
+ | * [[:Category:XCSG Tags]] | ||
+ | |||
+ | [[Category:XCSG]] |
Revision as of 14:48, 5 March 2014
The semantics of Field are those defined by UML [5, pp. 2-54, 2-69] for StructuralFeature.
The type of a Field must be a Class, DataType, or Interface.
Field redefinition is based on current UML 2 proposals. Semantically it implies compliance with the Liskov Substitution Principle (LSP) with respect to changes in the field’s signature and visibility. A field may also be renamed with no change in semantics. No other properties can be changed by redefinition.
When a single field redefines more than one inherited field, the inherited fields are effectively joined in the inheriting classifier.
The property implicitRedefinition allows us to distinguish between cases where redefinition is used implicitly to match the semantics of a particular language (e.g., C++ or Java) and cases in which the redefinition is explicitly specified by the user as part of that language (as in UML 2 and Eiffel).
Specification
Metaclass | Field |
---|---|
Extends | Feature, Variable |
Description | A feature whose value is a part of the state of an object or class, e.g. an attribute or association |
References | StructuralFeature [5, p. 2-14, Figure 2-5], [5, pp. 2-54, 2-69] |
Tag | implicitRedefinition |
---|---|
Description | Does the field represent an implicit redefinition (e.g., to match a particular language semantics) rather than a redefinition explicitly specified by the user? |
Tag | multiplicity |
---|---|
Description | The number of values that the feature may hold, typically specified as a range (min .. max) or ‘*’ (zero or more). In the common case in which the multiplicity is 1..1, the feature is a scalar. |
Tag | ordering |
---|---|
Description | Are the values associated with the feature ordered? |
Language mappings
Field maps to the concept of a field in Java, and to the concept of a data member in C++. Fields may hold either data values (attributes) or pointers to other entities (which represent the ends of an association).