OCL expressions in UML models: free text or modeled [message #9295] |
Wed, 21 February 2007 18:01  |
Eclipse User |
|
|
|
Originally posted by: chaves.inf.ufsc.nospam.br
It is not clear how OCL expressions should appear in UML models: as free
text (in the body of an OpaqueExpression - and the language should be
set to 'OCL') or in 'modeled' form (using ExpressionInOCL and its
corresponding body expression).
Is it a matter of choice? I prefer the latter as the former has the
downside of having to be parsed again and again.
Thanks,
Rafael
|
|
|
Re: OCL expressions in UML models: free text or modeled [message #9320 is a reply to message #9295] |
Thu, 22 February 2007 10:26  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Rafael,
Yes, it is a matter of choice. You can use OpaqueExpressions with text in
the body attribute and "OCL" for the language, even for purely
documentational reasons. This has the advantage of not bringing in another
metamodel (OCL) into your UML models, which might be awkward for example in
XMI interchange with other applications.
Other advantages of the ExpressionInOcl are that it is easier to trace the
dependencies of the OCL on elements in your model. This helps in, e.g.,
refactoring operations, to find OCL expressions that reference a
classifier, operation, etc. being renamed or moved. Of course, depending
on the refactoring, the actually text of the expression may or may not have
to change (the reference may not be fully qualified or may even be
implicit), so often refactoring will have to parse an expression again
anyway.
Cheers,
Christian
Rafael Chaves wrote:
> It is not clear how OCL expressions should appear in UML models: as free
> text (in the body of an OpaqueExpression - and the language should be
> set to 'OCL') or in 'modeled' form (using ExpressionInOCL and its
> corresponding body expression).
>
> Is it a matter of choice? I prefer the latter as the former has the
> downside of having to be parsed again and again.
>
> Thanks,
>
> Rafael
|
|
|
Powered by
FUDForum. Page generated in 0.03203 seconds