Difference between revisions of "XCSG:Field"

From AtlasWiki
Jump to: navigation, search
(Specification: removing tags not relevant to XCSG plans)
(simplifying semantics)
Line 1: Line 1:
The semantics of Field are those defined by UML [5, pp. 2-54, 2-69] for StructuralFeature.
+
A Field is a [[Variable]] associated with a [[Classifier]] (a [[ClassVariable]]), or with instances of a [[Classifier]] (an [[InstanceVariable]]).
 
+
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 ==
 
== Specification ==
 
{{Node
 
{{Node
| extends = Feature, Variable
+
| extends = Variable
 
| description = A feature whose value is a part of the state of an object or class, e.g. an attribute or association.
 
| 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]
 
 
}}
 
}}
  
 
==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++.

Revision as of 13:10, 16 April 2014

A Field is a Variable associated with a Classifier (a ClassVariable), or with instances of a Classifier (an InstanceVariable).

Specification

Metaclass Field
Extends Variable
Description A feature whose value is a part of the state of an object or class, e.g. an attribute or association.
Direct Subkinds ClassVariable, InstanceVariable
All Superkinds Variable, Node, ModelElement
Specified In Edges

Inherited From In Edge Predecessor Multiplicity Description
Variable DataFlow (Edge) DataFlow (Node) Connects DataFlow nodes to one another and to Variables, linking the origin of data to locations that it is modified or consumed.
Specified Out Edges

Inherited From Out Edge Successor Multiplicity Description
Variable DataFlow (Edge) DataFlow (Node) Connects DataFlow nodes to one another and to Variables, linking the origin of data to locations that it is modified or consumed.

DefinedAs TypeAlias 0..1 Connects a Variable or DataFlow node which received its Type via a TypeAlias (such as a C/C++ typedef) to that TypeAlias.
InstanceVariableWritten InstanceVariableAssignment Connects a value (DataFlow (Node) or Variable) representing an object instance to an InstanceVariableAssignment representing a write to a field of that object.
TypeOf Type 1 Links a Variable or DataFlow node to its Type
Known Possible In Edges

Inherited From In Edge Predecessor Multiplicity Description
Variable HasVariable Namespace 1 Links a Classifier or Package to one of its Variables.

InterproceduralDataFlow Assignment Represents data flows between Functions, or involving Variables visible to multiple Functions.
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
Variable InterproceduralDataFlow DataFlow (Node) Represents data flows between Functions, or involving Variables visible to multiple Functions.
Node Contains Node Indicates that the predecessor contains the successor in a sense specified by the specific type of Contains edge.

Language mappings

Field maps to the concept of a field in Java, and to the concept of a data member in C++.