Package org.omg.cwm.foundation.expressions

The CWM Expressions metamodel provides basic support for the definition of expression trees within the CWM.

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.
 

Package org.omg.cwm.foundation.expressions Description

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:

Expressions metamodel Feature (from Core) FeatureNode ConstantNode ElementNode ExpressionNode Classifier (from Core) ModelElement (from Core) Element (from Core)

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.

A CWM expression tree for the formula E = mc2 OperationArgument OperationArgument OperationArgument NodeFeature NodeFeature NodeFeature NodeFeature NodeFeature NodeFeature ConstantNode FeatureNode FeatureNode FeatureNode FeatureNode FeatureNode FeatureNode

For Additional Information

For additional information, see the CWM specification at http://www.cwmforum.org.

Since:
1.0


Copyright 1997-2005 by Object Management Group, Inc. (http://www.omg.org/), 250 First Ave. Needham, MA 02494 U.S.A. All rights reserved. Unless otherwise indicated, users may make a single copy of the contents, in whole or in part, of this web site strictly for personal, non-commercial use. In the event that all or part of this site is downloaded for personal use, users shall maintain all proprietary notices including copyright notices that appear on or in connection with that content. Other than creating a single copy of contents for personal use as described herein, users may not copy, reproduce, distribute, republish, download, display, post or transmit in any form or by any means, including but not limited to electronic, mechanical, photocopying, recording, or other means, any content found or linked to the OMG web site without the prior express written permission of OMG. Any unauthorized use of any content contained on the OMG web site may violate the copyright laws, trademark laws, laws relating to publicity and privacy, and other regulations and statutes in the U.S. and other countries.