OpaqueExpression
An opaque expression is an uninterpreted textual statement that denotes a (possibly empty) set of values when evaluated
in a context.
Description
An opaque expression contains a language-specific text string used to describe a value or values, and an optional
specification of the language.
One predefined language for specifying expressions is OCL. Natural language or programming languages may also be
used.
Attributes
·body: String [1] | The text of the expression.
|
·language: String [0..1] | Specifies the language in which the expression is stated. The interpretation of the expres- sion body depends on the language. If language is unspecified, it might be implicit from the expression body or the context.
|
Associations
No additional associations.
Constraints
No additional constraints.
Semantics
The interpretation of the expression body depends on the language. If the language is unspecified, it might be implicit
from the expression body or the context.
It is assumed that a linguistic analyzer for the specified language will evaluate the body. The time at which the body will
be evaluated is not specified.
Notation
An opaque expression is displayed as a text string in a particular language. The syntax of the string is the responsibility
of a tool and a linguistic analyzer for the language.
An opaque expression is displayed as a part of the notation for its containing element.
The language of an opaque expression, if specified, is often not shown on a diagram. Some modeling tools may impose a
particular language or assume a particular default language. The language is often implicit under the assumption that the
form of the expression makes its purpose clear. If the language name is shown, it should be displayed in braces ({})
before the expression string.
Style Guidelines
A language name should be spelled and capitalized exactly as it appears in the document defining the language. For
example, use OCL, not ocl.
Examples
a > 0
{OCL} i > j and self.size > i
average hours worked per week