|Re: [OCLInEcore] Change default error messages [message #633294 is a reply to message #633214]
||Sat, 16 October 2010 05:13
| Ed Willink
Registered: July 2009
I'm not fond of Check or Xpand, since they use a hybrid Java-like
I can see an argument for a different OCL syntax that fixes the "->"
surprise, but not one that fails to realize other important OCL
My challenge is to make MDT/OCL sufficiently robust and re-useable to
encourage non MDT/OCL Eclipse projects to migrate. Making the Standard
Library model-driven may allow a Check syntax to use MDT/OCL tooling.
A Complete OCL document should provide similar capabilities to Check in
standard form; we just need to solve the problme of how a tool using a
model with an associated meta-model discovers the complementing Complete
OCL. For embedded OCLinEcore this is all much easier.
Your example of an arbitrary String expression was exactly what I'd
intended. My only uncertainty is whether the string expression is
evaluated in the scope of the declaration or the scope of the failed
invariant, which could allow re-use of already computed let variables
and prevailing iterator content. If 'invalid' is relaxed to behave as,
rather than be, a singleton, then 'invalid' (just like an exception)
could carry a reason and/or exception trace from the point of creation
of an invalid value to the point of analysis of that invalid value.
On 15/10/2010 17:40, Jos Warmer wrote:
> In Check the error message is simply an OCL expression of type String.
> This allows full access to information from the model, not just one
> element. You could write
> inv ConstraintName('Unable to find ' + self.target.name + ' for ' +
> self.kindName + ' in model ' + self.model.name):
> <<the invariant in OCL>>
> I think this just a logical extension of what is proposed already. And
> it only uses OCL, nothing else as you rightfully want.
Powered by FUDForum
. Page generated in 0.08444 seconds