|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
ConstantNode | Instances of the ConstantNode class are ExpressionNodes that represent constant values within expressions. |
ElementNode | An ElementNode is a node in an expression that references some ModelElement instance. |
ExpressionNode | All node types within an expression are derived from the ExpressionNode type. |
ExpressionNodeClassifier | The ExpressionNodeClassifier association identifies the type of an ExpressionNode instance. |
FeatureNode | The FeatureNode class represents ExpressionNode instances that are features (i.e., attributes or operations) of some Classifier instance within the CWM. |
NodeFeature | The NodeFeature association identifies the Feature (usually, an Attribute or Operation subtype) that FeatureNode represents. |
OperationArgument | The OperationArgument association identifies and orders the actual arguments of an Operation indicated by the FeatureNode end of the association. |
ReferencedElement | The ReferencedElement association links the ElementNode instances of an expression with the ModelElement instances to which they refer. |
The CWM Expressions metamodel provides basic support for the definition of expression trees within the CWM. The intent of the Expressions metamodel is to provide a place for other CWM packages (such as Transformation) and CWM compliant tools to record shared expressions in a common form that can be used for interchange and lineage tracking.
The Expressions package depends on the following package:
The expression concept in the CWM Foundation takes a functional view of expression trees, resulting in the ability of relatively few expression types to represent a broad range of expressions. Every function or traditional mathematical operator that appears in an expression hierarchy is represented as a FeatureNode. For example, the arithmetic plus operation "a + b" can be thought of as the function "sum(a, b)." The semantics of a particular function or operation are left to specific tool implementations and are not captured by the CWM.
The hierarchical nature of the CWM's representation of expressions is achieved by the recursive nature of the OperationArgument association. This association allows the sub-hierarchies within an expression to be treated as actual parameters of their parent nodes.
By way of example, the following instance diagram shows one representation of a
CWM expression tree for the well-known Einstein equation E = mc2
.
To better understand how the equation is mapped into the expression tree, the formula can be
rewritten in a functional notation as:
Assign(E, Multiply(m, Power(c, 2)))
This functional form of the equation is then mapped into a set of expression tree instances as shown in the figure below.
Alternatively, if sharing and lineage tracking of elements within the expression
are not required, the expression could be stored using an Attribute of type
ExpressionNode by assigning the string "E = mc2
" as the Attribute's
expression::body value. For flexibility, use of the expression
attribute within an expression hierarchy is allowed, but the precise semantics
of such situations are not defined by CWM.
For additional information, see the CWM specification at http://www.cwmforum.org.
|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |