| model1 UML Documentation |
| Summary:AttributesPropertiesComments | Detail:Attributes |
A Constraint defines a rule that restricts the state or behavior of one or more elements in the meta-model. When a Constraint is attached to a ModelElement, the rule it encodes applies to all relevant instances of the ModelElement in a model.
A Constraint rule, represented by the 'expression' attribute, may be encoded in any form. The 'language' attribute may be used to denote the language and encoding scheme used.
While some Constraints on a model may need to be treated as invariant, it is often convenient for other Constraints to be relaxed, for instance while a model is being edited. While, the 'evaluationPolicy' attribute is used to represent these two cases, this information is at best advisory, since the MOF specification does not currently state how and when Constraints should be enforced.
| Attributes | ||
| Class |
Each constraint can be defined as immediate or deferred. For immediate Constraints, the constraint violation will be detected and reported within an operation in the chain of operations between the operation initiated by the MOF user and the operation that caused the constraint violation. The effect of an operation that violates an immediate constraint on the state of the object or objects being altered is implementation specific, and possibly undefined. However, if possible, an implementation should reverse the effects of the operation. For deferred Constraints, the constraint violation can only be detected when the Constraint is explicitly evaluated. The MOF defines an operation for such constraint evaluation, the verify operation. When the verify operation is invoked on a Constraint's container, the constraint is evaluated and a constraint violation isdetected, if present. |
|
| Primitive Type string |
The Constraint's expression attribute provides a representation of the constraint. The MOF has no specific requirement to interpret this expression, or to validate it against the language attribute. The specific handling of the expression will necessarily vary with the language used. However, it is expected that for any language an implementation accepts, it will enforce the constraints expressed in that language. The expression can be represented in any format, including text or a composition of objects. |
|
| Primitive Type string |
The language representing this Constraint's expression is defined in this attribute. Since it is a string, most any language can be represented, including format variances in a language (e.g., OCL as text verses OCL as a parse tree). |
|
Properties:
| Alias | |
| Classifier Behavior | |
| Collections | |
| Is Abstract | false |
| Is Active | false |
| Is Leaf | false |
| Keywords | |
| Name | Constraint |
| Name Expression | |
| Owned Template Signature | |
| Owner | Package model1 |
| Owning Parameter | |
| Package | Package model1 |
| Packageable Element visibility | public |
| Qualified Name | model1::model1::Constraint |
| Representation | |
| Stereotype | |
| Template Parameter | |
| Visibility | public |
| Attribute Details |
public Class evaluationPolicy
Each constraint can be defined as immediate or deferred. For immediate Constraints, the constraint violation will be detected and reported within an operation in the chain of operations between the operation initiated by the MOF user and the operation that caused the constraint violation. The effect of an operation that violates an immediate constraint on the state of the object or objects being altered is implementation specific, and possibly undefined. However, if possible, an implementation should reverse the effects of the operation.
For deferred Constraints, the constraint violation can only be detected when the Constraint is explicitly evaluated. The MOF defines an operation for such constraint evaluation, the verify operation. When the verify operation is invoked on a Constraint's container, the constraint is evaluated and a constraint violation isdetected, if present.
| Aggregation | none |
| Alias | |
| Association | |
| Association End | |
| Class | Class Constraint |
| Collections | |
| Datatype | |
| Default | |
| Default Value | |
| Is Composite | false |
| Is Derived | false |
| Is Derived Union | false |
| Is Leaf | false |
| Is Ordered | false |
| Is Read Only | false |
| Is Static | false |
| Is Unique | true |
| Keywords | |
| Lower | 1 |
| Lower Value | |
| Multiplicity | 1 |
| Name | evaluationPolicy |
| Name Expression | |
| Opposite | |
| Owned Template Signature | |
| Owner | Class Constraint |
| Owning Association | |
| Owning Parameter | |
| Qualified Name | model1::model1::Constraint::evaluationPolicy |
| Stereotype | |
| Template Parameter | |
| Type | Class |
| Upper | 1 |
| Upper Value | |
| Visibility | public |
public Primitive Type string expression
The Constraint's expression attribute provides a representation of the constraint. The MOF has no specific requirement to interpret this expression, or to validate it against the language attribute. The specific handling of the expression will necessarily vary with the language used. However, it is expected that for any language an implementation accepts, it will enforce the constraints expressed in that language. The expression can be represented in any format, including text or a composition of objects.
| Aggregation | none |
| Alias | |
| Association | |
| Association End | |
| Class | Class Constraint |
| Collections | |
| Datatype | |
| Default | |
| Default Value | |
| Is Composite | false |
| Is Derived | false |
| Is Derived Union | false |
| Is Leaf | false |
| Is Ordered | false |
| Is Read Only | false |
| Is Static | false |
| Is Unique | true |
| Keywords | |
| Lower | 1 |
| Lower Value | |
| Multiplicity | 1 |
| Name | expression |
| Name Expression | |
| Opposite | |
| Owned Template Signature | |
| Owner | Class Constraint |
| Owning Association | |
| Owning Parameter | |
| Qualified Name | model1::model1::Constraint::expression |
| Stereotype | |
| Template Parameter | |
| Type | Primitive Type string |
| Upper | 1 |
| Upper Value | |
| Visibility | public |
public Primitive Type string language
The language representing this Constraint's expression is defined in this attribute. Since it is a string, most any language can be represented, including format variances in a language (e.g., OCL as text verses OCL as a parse tree).
| Aggregation | none |
| Alias | |
| Association | |
| Association End | |
| Class | Class Constraint |
| Collections | |
| Datatype | |
| Default | |
| Default Value | |
| Is Composite | false |
| Is Derived | false |
| Is Derived Union | false |
| Is Leaf | false |
| Is Ordered | false |
| Is Read Only | false |
| Is Static | false |
| Is Unique | true |
| Keywords | |
| Lower | 1 |
| Lower Value | |
| Multiplicity | 1 |
| Name | language |
| Name Expression | |
| Opposite | |
| Owned Template Signature | |
| Owner | Class Constraint |
| Owning Association | |
| Owning Parameter | |
| Qualified Name | model1::model1::Constraint::language |
| Stereotype | |
| Template Parameter | |
| Type | Primitive Type string |
| Upper | 1 |
| Upper Value | |
| Visibility | public |
| Comments |
A Constraint rule, represented by the 'expression' attribute, may be encoded in any form. The 'language' attribute may be used to denote the language and encoding scheme used.
While some Constraints on a model may need to be treated as invariant, it is often convenient for other Constraints to be relaxed, for instance while a model is being edited. While, the 'evaluationPolicy' attribute is used to represent these two cases, this information is at best advisory, since the MOF specification does not currently state how and when Constraints should be enforced.
| model1 UML Documentation |
| Summary:AttributesPropertiesComments | Detail:Attributes |