Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL expressions in UML models: free text or modeled
OCL expressions in UML models: free text or modeled [message #9295] Wed, 21 February 2007 23:01 Go to next message
Eclipse UserFriend
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 15:26 Go to previous message
Eclipse UserFriend
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
Previous Topic:def expressions again
Next Topic:impedance mismatch between OCL and UML2
Goto Forum:
  


Current Time: Fri Apr 26 12:06:41 GMT 2024

Powered by FUDForum. Page generated in 0.04058 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top