Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
UML / 05-04-01.pdf
Скачиваний:
40
Добавлен:
12.05.2015
Размер:
4.17 Mб
Скачать

ISO/IEC 19501:2005(E)

computer languages as well as plain text (which cannot be parsed by a tool, of course, and is therefore only for human information). The OCL language is defined in the “Object Constraint Language Specification” chapter.

5.10.6 Selected OCL Notation

Syntax for some common navigational expressions are shown below. These forms can be chained together. The leftmost element must be an expression for an object or a set of objects. The expressions are meant to work on sets of values when applicable.

item ‘.’ selector

The selector is the name of an attribute in the item or the name of the target end

 

of a link attached to the item. The result is the value of the attribute or the related

 

object(s). The result is a value or a set of values depending on the multiplicities of

 

the item and the association.

 

 

item ‘.’ selector ‘[‘ qualifier-value ‘]’

The selector designates a qualified association that qualifies the item. The

 

qualifier-value is a value for the qualifier attribute. The result is the related object

 

selected by the qualifier. Note that this syntax is applicable to array indexing as a

 

form of qualification.

 

 

set ‘->’ ‘select’ ‘(‘ boolean-expression ‘)’

The boolean-expression is written in terms of objects within the set. The result is

 

the subset of objects in the set for which the boolean expression is true.

 

 

5.10.7 Examples

flight.pilot.training_hours > flight.plane.minimum_hours

company.employees−>select (title = “Manager” and self.reports−>size > 10)

5.11 Note

A note is a graphical symbol containing textual information (possibly including embedded images). It is a notation for rendering various kinds of textual information from the metamodel, such as constraints, comments, method bodies, and tagged values.

5.11.1 Semantics

A note is a notational item. It shows textual information within some semantic element.

5.11.2 Notation

A note is shown as a rectangle with a “bent corner” in the upper right corner. It contains arbitrary text. It appears on a particular diagram and may be attached to zero or more modeling elements by dashed lines.

5.11.3 Presentation Options

A note may have a stereotype.

A note with the keyword “constraint” or a more specific stereotype of constraint (such as the code body for a method) designates a constraint that is part of the model and not just part of a diagram view. Such a note is the view of a model element (the constraint).

ISO/IEC 2005 - All rights reserved

183

Соседние файлы в папке UML