Question about constraints vs. invariants [message #687031] |
Mon, 23 May 2011 19:55 |
Eclipse User |
|
|
|
Originally posted by:
Hi,
The EMF delegates mechanism provides two ways of validating the
EObjects, constraints and invariants. AFAIU, invariants are meant to be
small and quick checks that can happen often while constraints are meant
to implement more global checks. What I don't understand is how this has
lead to the particular implementation of these. In particular, invariant
are implemented using modelled EOperation with a specific signature. Why
has this particular implementation been chosen and how can the arguments
of the EOperation be used in the body?
Regards,
Hallvard
|
|
|
|
Re: Question about constraints vs. invariants [message #687033 is a reply to message #687032] |
Mon, 23 May 2011 21:46 |
Eclipse User |
|
|
|
Originally posted by:
On 23.05.11 22.11, Ed Willink wrote:
>
> The significant difference is that an Ecore invariant is callable
> whereas an Ecore constraint is not. This may be useful from a more
> sophisticated environment that allows selective invocation and
> re-invocation of constraints.
Yes, that seems like a useful property of invariants.
> The arguments can only be used from Java bodies.
What can the arguments be used for in that case? Provide better
messages? I'm implementing support for Javascript-based delegates
(similar to the OCL support), so I wonder if there are special use cases
I should support.
Hallvard
|
|
|
|
Powered by
FUDForum. Page generated in 0.02993 seconds