model validation [message #54502] |
Mon, 28 April 2008 11:38  |
Eclipse User |
|
|
|
Originally posted by: hannes-n.gmx.de
Hello,
The actual project I'm working on has a need for a model-editor, and we
decided to use the model-generator of emf, because we're working with emf
anyway.
Moreover there are constraints for the model, which need to be checked
whilst the editor is running, in a way we need runtime model validation.
Could you tell me a simplistic approach to realize that?
I've tried the MDT-OCLTools from Miguel Garica, and the compiler works
very nice, and compiles the constraints as functions into the model code.
But what's the easiest way to get a connection to the editor (for the
validation)?
I'm thankful for any answer,
regards,
Hannes
|
|
|
Re: model validation [message #54912 is a reply to message #54502] |
Sun, 04 May 2008 10:48   |
Eclipse User |
|
|
|
Originally posted by: give.a.damus.gmail.com
Hi, Hannes,
If the OCLTools compiler suits your needs, then the easiest way to
integrate the constraint into your editor is via the generated
EValidator class. This validator would call into the
OCLTools-generated invariant-constraint methods in your model API.
Your editor, then, can use EMF's Diagnostician API to validate an
object whenever it has changed and rebuild its problem markers (as is
done by the ValidateAction generated for your editor). A more
sophisticated approach would analyze the OCL constraint expressions to
determine, for any particular change, which constraints' values may
have changed and for which objects. The MDT OCL API doesn't provide
anything beyond the abstract syntax tree to assist with this analysis.
For more information about generating and using an EValidator, see the
EMF SDK's Developer Guide in the Eclipse help viewer, or the
documentation on the EMF homepage.
HTH,
Christian
On Monday 04-28-2008 (11:38), Hannes Nützmann wrote:
> Hello,
> The actual project I'm working on has a need for a model-editor, and
> we decided to use the model-generator of emf, because we're working
> with emf anyway.
> Moreover there are constraints for the model, which need to be
> checked whilst the editor is running, in a way we need runtime model
> validation.
> Could you tell me a simplistic approach to realize that?
> I've tried the MDT-OCLTools from Miguel Garica, and the compiler
> works very nice, and compiles the constraints as functions into the
> model code. But what's the easiest way to get a connection to the
> editor (for the validation)?
> I'm thankful for any answer,
> regards,
> Hannes
--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
|
|
|
Re: model validation [message #58034 is a reply to message #54502] |
Mon, 09 June 2008 13:34  |
Eclipse User |
|
|
|
Hannes,
After providing you with an early version of the OCL to Java compiler (and
answering your
off-list questions), I was wondering whether your master thesis report will
be available
online.
If your company (http://www.carmeq.de) has nothing against it, please
consider making it
available online as has been the case for:
|
|
|
Powered by
FUDForum. Page generated in 0.02883 seconds