Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Constraint reference contents in a subtype
Constraint reference contents in a subtype [message #1196597] Tue, 19 November 2013 08:47 Go to next message
Felix Dorner is currently offline Felix Dorner
Messages: 203
Registered: March 2012
Senior Member
Hi,

Can I do this with EMF/OCL (Sorry for the stupid example :))?


Animal
-children [0-*] : Animal

Dog -> Animal
Cat -> Animal

I now would like to define a constraint on Dog, such that a dog's
children may only be dogs and a Cat's chidren well.. you guess.

The constraint would be defined on a different type than the feature
that is being constraint.

I also thought to use maybe this:
http://ed-merks.blogspot.it/2013/01/emf-can-do-what.html which serves a
similar purpose.

Thanks,
Felix
Re: Constraint reference contents in a subtype [message #1196882 is a reply to message #1196597] Tue, 19 November 2013 11:45 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4026
Registered: July 2009
Senior Member
Yes.

On 19/11/2013 13:47, Felix Dorner wrote:
> Hi,
>
> Can I do this with EMF/OCL (Sorry for the stupid example :))?
>
>
> Animal
> -children [0-*] : Animal
>
> Dog -> Animal
> Cat -> Animal
>
> I now would like to define a constraint on Dog, such that a dog's
> children may only be dogs and a Cat's chidren well.. you guess.
>
> The constraint would be defined on a different type than the feature
> that is being constraint.
>
> I also thought to use maybe this:
> http://ed-merks.blogspot.it/2013/01/emf-can-do-what.html which serves
> a similar purpose.
>
> Thanks,
> Felix
Previous Topic:OCL invariants in ecore file doesn't work reliable
Next Topic:"misplaced contructs" using second import statement
Goto Forum:
  


Current Time: Thu Aug 21 10:06:41 EDT 2014

Powered by FUDForum. Page generated in 0.02597 seconds