Difference between revisions of "XCSG:InstanceVariable"

From AtlasWiki
Jump to: navigation, search
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
An [[InstanceVariable]] defines the characteristics of a variable that shares the lifetime of an instance of it's namespace, where the namespace does not have a program lifetime.  For example non-static fields in C++ and Java.  Unlike [[XCSG:ProgramVariable|ProgramVariables]] which are typically accessed via their enclosing namespace, InstanceVariables are accessed via an instance of the namespaceFor example Foo::programVariable and fooInst->instanceVariable in C++.
+
An [[InstanceVariable]] is a [[Field]] that shares the lifetime of object instances whose [[TypeOf|type]] is the Classifier they are associated withExamples include non-static fields in C++ and Java, and fields of structs in C.
 
+
Although non-static local variables in C/C++ and Java fit this description, they are modeled using [[XCSG:StackVariable|StackVariable]] since their relationship to [[Dataflow]] is different than [[InstanceVariable]].
+
  
 
==Specification==
 
==Specification==
 
{{Node
 
{{Node
| extends = Variable
+
| extends = Field
 
| description = A [[Variable]] associated with instances of a [[Classifier]].
 
| description = A [[Variable]] associated with instances of a [[Classifier]].
 +
}}
 +
 +
 +
{{XCSGTag
 +
| name = transientField
 +
| description = Indicates that this InstanceVariable will not be saved when an object is serialized.
 
}}
 
}}

Latest revision as of 15:25, 2 November 2015

An InstanceVariable is a Field that shares the lifetime of object instances whose type is the Classifier they are associated with. Examples include non-static fields in C++ and Java, and fields of structs in C.

Specification

Metaclass InstanceVariable
Extends Field
Description A Variable associated with instances of a Classifier.
All Superkinds Field, Variable, Node, ModelElement
Specified In Edges
In Edge Predecessor Multiplicity Description
HasVariable Classifier 1 Links a Classifier or Package to one of its Variables.

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.


Tag transientField
Description Indicates that this InstanceVariable will not be saved when an object is serialized.