Previous Table of Contents Next


9.8.2 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 language-specific text strings used to describe a value or values, and an optional specification of the languages.

   One predefined language for specifying expressions is OCL. Natural language or programming languages may also be used.

   Generalizations

   • “ValueSpecification? on page 48

   Attributes

   Associations

   No additional associations

   Constraints

   No additional constraints

   Semantics

   The interpretation of the expression bodies depends on the languages. Languages are matched to body strings by order. If the languages are unspecified, it might be implicit from the expression bodies or the context.

   It is assumed that a linguistic analyzer for the specified languages will evaluate the bodies. The time at which the bodies will be evaluated is not specified.

   Notation

   An opaque expression is displayed as text string in particular languages. The syntax of the strings are the responsibility of a tool and linguistic analyzers for the language.

   An opaque expression is displayed as a part of the notation for its containing element.

   The languages of an opaque expression, if specified, are 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 to which it corresponds.

   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 > iaverage hours worked per week