Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Recalling an invariant from an another invariant in OCLinEcore
Recalling an invariant from an another invariant in OCLinEcore [message #1294266] Sun, 13 April 2014 09:42 Go to next message
Emre T is currently offline Emre TFriend
Messages: 119
Registered: April 2013
Senior Member
Hello,

is it possible to recall an in the same class declared invariant in another invariant? An example would look like this:

invariant XYZ: -- something something --
invariant Choice: self.booleanValue = true implies "XYZ"

I know I actually can copy paste the entire invariant, but I would have really preferred such an option.

Thanks!

Emre
Re: Recalling an invariant from an another invariant in OCLinEcore [message #1294414 is a reply to message #1294266] Sun, 13 April 2014 12:37 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4189
Registered: July 2009
Senior Member
Hi

No.

You can avoid cut and paste by defining the re-useable functionality as
a property or operation.

def: XYZ : Boolean = ....

(Since you can do that, there is case for a language extension that
allows invariant names to be accessed as a variable. ... implies XYZ.)

Regards

Ed Willink


On 13/04/2014 10:42, Emre T wrote:
> Hello,
>
> is it possible to recall an in the same class declared invariant in
> another invariant? An example would look like this:
>
> invariant XYZ: -- something something --
> invariant Choice: self.booleanValue = true implies "XYZ"
>
> I know I actually can copy paste the entire invariant, but I would
> have really preferred such an option.
>
> Thanks!
>
> Emre
Previous Topic:Problem with OCL
Next Topic:OCL expression updates
Goto Forum:
  


Current Time: Tue Dec 23 00:08:50 GMT 2014

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

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