Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Validation of Meta- and Instance Models
Validation of Meta- and Instance Models [message #419927] Fri, 13 June 2008 13:35 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hello all,

the last day, i've sniffered across the vast posssibilities in EMF to
validate models. I also read the great artcile of Christian Damus abaout
model integrity. Because of the complex topic, i'm a bit confused on how to
start with validation. I already know the OCL Spec and want it to use both
for model validation and code generation. First, let my summerize, whether
i've understand the main purpose of the topic.

1. The article of Christian deals with integrity of model, so that some
aspects are automatically generated. This has no relationship to the
validation framework, except that he also uses OCL, which is translated into
Java Code.

2. The validation framework parses the m1 model, if the user triggers the
Validate button of the editor. With this functionality, it is possible to
validate against sophisticated constraints (such as XOR's between
associations), and not only against the simple required-constraint, for
instance.

3. One should work with the OCL AST, if one want to generate, for instance,
body expressions in the code, which was generated from the ocl annotated m1
model. With the AST, it is possible to access the terminals of the
expression ond therefore, map the semantics of the ocl to the target
language of one's desire. (I'm going to use JET or JET2 for the generation
of code from my m1 model).

So, may i have got the main purpose of these different approaches or am I
totally wrong?

I think, especially the third point is quite complex. Does anyone know,
whether there is a tool outside, that mapps typical ocl constraints, to
programming language concept's?

Thanks a lot for any information.

Timothy
Re: Validation of Meta- and Instance Models [message #419948 is a reply to message #419927] Fri, 13 June 2008 17:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-68RK0vnbuePwb3XEbpjQ
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Timothy,

Find some replies in-line, below.

HTH,

Christian


On Fri, 2008-06-13 at 15:35 +0200, Timothy Marc wrote:

> Hello all,
>
> the last day, i've sniffered across the vast posssibilities in EMF to
> validate models. I also read the great artcile of Christian Damus abaout
> model integrity. Because of the complex topic, i'm a bit confused on how to
> start with validation. I already know the OCL Spec and want it to use both
> for model validation and code generation. First, let my summerize, whether
> i've understand the main purpose of the topic.



Thanks! I'm glad that you found the article helpful.


> 1. The article of Christian deals with integrity of model, so that some
> aspects are automatically generated. This has no relationship to the
> validation framework, except that he also uses OCL, which is translated into
> Java Code.


Well, not exactly translated into Java code, but generating Java code
that interprets the OCL. I think that's what you meant, anyway, but
just to be clear ...




> 2. The validation framework parses the m1 model, if the user triggers the
> Validate button of the editor. With this functionality, it is possible to
> validate against sophisticated constraints (such as XOR's between
> associations), and not only against the simple required-constraint, for
> instance.

You mean, simple constraints like multiplicities? Right, the "batch
model" validation of the Validation Framework component and the
generated EValidator constraints are intended to check these kinds of
more elaborate constraints.




> 3. One should work with the OCL AST, if one want to generate, for instance,
> body expressions in the code, which was generated from the ocl annotated m1
> model. With the AST, it is possible to access the terminals of the
> expression ond therefore, map the semantics of the ocl to the target
> language of one's desire. (I'm going to use JET or JET2 for the generation
> of code from my m1 model).


Right. You might have a look at the proposal for the OCL Tools
component of MDT and the initial contribution that accompanies it. This
initial contribution includes an OCL-to-Java transformation. It is
focused on generating pure Java implementations of OCL-specified
constraints in an Ecore package. The question of analyzing the AST to
determine which features should trigger constraints when they change was
to come later in the plan.




> So, may i have got the main purpose of these different approaches or am I
> totally wrong?


I don't think I followed exactly what the different approaches are. Do
you mean, the distinction between static validation and dynamic
(on-the-fly) validation? The EMF Validation Framework components does,
also, implement the latter, especially in support of transaction
validation in the EMF Transaction component. However, it doesn't make
use of OCL AST analysis to determine trigger points for evaluation of
constraints.




> I think, especially the third point is quite complex. Does anyone know,
> whether there is a tool outside, that mapps typical ocl constraints, to
> programming language concept's?


The OCL Tools component makes a start on this in its OCL-to-Java
transformation, as I mentioned already.


>
> Thanks a lot for any information.
>
> Timothy
>
>
>

--=-68RK0vnbuePwb3XEbpjQ
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Timothy,<BR>
<BR>
Find some replies in-line, below.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Fri, 2008-06-13 at 15:35 +0200, Timothy Marc wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello all,</FONT>

<FONT COLOR="#000000">the last day, i've sniffered across the vast posssibilities in EMF to </FONT>
<FONT COLOR="#000000">validate models. I also read the great artcile of Christian Damus abaout </FONT>
<FONT COLOR="#000000">model integrity. Because of the complex topic, i'm a bit confused on how to </FONT>
<FONT COLOR="#000000">start with validation. I already know the OCL Spec and want it to use both </FONT>
<FONT COLOR="#000000">for model validation and code generation. First, let my summerize, whether </FONT>
<FONT COLOR="#000000">i've understand the main purpose of the topic.</FONT>
</PRE>
</BLOCKQUOTE>
<PRE>

</PRE>
Thanks!&nbsp; I'm glad that you found the article helpful.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">1. The article of Christian deals with integrity of model, so that some </FONT>
<FONT COLOR="#000000">aspects are automatically generated. This has no relationship to the </FONT>
<FONT COLOR="#000000">validation framework, except that he also uses OCL, which is translated into </FONT>
<FONT COLOR="#000000">Java Code.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Well, not exactly translated into Java code, but generating Java code that interprets the OCL.&nbsp; I think that's what you meant, anyway, but just to be clear ...<BR>
<BR>
<PRE>

</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">2. The validation framework parses the m1 model, if the user triggers the </FONT>
<FONT COLOR="#000000">Validate button of the editor. With this functionality, it is possible to </FONT>
<FONT COLOR="#000000">validate against sophisticated constraints (such as XOR's between </FONT>
<FONT COLOR="#000000">associations), and not only against the simple required-constraint, for </FONT>
<FONT COLOR="#000000">instance.</FONT>
</PRE>
</BLOCKQUOTE>
You mean, simple constraints like multiplicities?&nbsp; Right, the &quot;batch model&quot; validation of the Validation Framework component and the generated EValidator constraints are intended to check these kinds of more elaborate constraints.<BR>
<BR>
<PRE>

</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">3. One should work with the OCL AST, if one want to generate, for instance, </FONT>
<FONT COLOR="#000000">body expressions in the code, which was generated from the ocl annotated m1 </FONT>
<FONT COLOR="#000000">model. With the AST, it is possible to access the terminals of the </FONT>
<FONT COLOR="#000000">expression ond therefore, map the semantics of the ocl to the target </FONT>
<FONT COLOR="#000000">language of one's desire. (I'm going to use JET or JET2 for the generation </FONT>
<FONT COLOR="#000000">of code from my m1 model).</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Right.&nbsp; You might have a look at the proposal for the OCL Tools component of MDT and the initial contribution that accompanies it.&nbsp; This initial contribution includes an OCL-to-Java transformation.&nbsp; It is focused on generating pure Java implementations of OCL-specified constraints in an Ecore package.&nbsp; The question of analyzing the AST to determine which features should trigger constraints when they change was to come later in the plan.<BR>
<BR>
<PRE>

</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">So, may i have got the main purpose of these different approaches or am I </FONT>
<FONT COLOR="#000000">totally wrong?</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
I don't think I followed exactly what the different approaches are.&nbsp; Do you mean, the distinction between static validation and dynamic (on-the-fly) validation?&nbsp; The EMF Validation Framework components does, also, implement the latter, especially in support of transaction validation in the EMF Transaction component.&nbsp; However, it doesn't make use of OCL AST analysis to determine trigger points for evaluation of constraints.<BR>
<BR>
<PRE>

</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I think, especially the third point is quite complex. Does anyone know, </FONT>
<FONT COLOR="#000000">whether there is a tool outside, that mapps typical ocl constraints, to </FONT>
<FONT COLOR="#000000">programming language concept's?</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
The OCL Tools component makes a start on this in its OCL-to-Java transformation, as I mentioned already.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>

<FONT COLOR="#000000">Thanks a lot for any information.</FONT>

<FONT COLOR="#000000">Timothy</FONT>



</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-68RK0vnbuePwb3XEbpjQ--
Re: Validation of Meta- and Instance Models [message #419953 is a reply to message #419948] Fri, 13 June 2008 22:01 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Dear Christian,

thanks again. I haven't read your article till the end, i better should
have read it, because, I mixed the EMF Validation approaches. After
posting this message, i browsed through the Eclipse online help, where i
found some furhter information concerning Validation.

If i am correct, there are two validation concepts in EMF/EMFT. The
Validation concept EMF cames with, is just a simple one, like you
mentioned in your article. Easy to orchestrate and no need for a
explicit constraint language. It also possible, to use Java code. I have
found a really simple four-step-tutorial at EMF Framework -> EMF
Validation Framework capabilities online at Eclipse help.

The main entry EMF Validation Framework is the one, you mentioned in the
related resources in your article as EMFT Validation Framework, a more
customer oriented approach, where one can use OCL too, if he wants.

Is this correct? And if not, what are the differences between the EMF
Overview -> EMF Validation Framework and the main entry EMF Validation
Framework Developers Guide. To me, it looks, as the included one is not
so sophisticated, but only for checking m1 instances, when the user
presses Validate. But what is the second one for?

Hope, i'm writing not to confusing. It's very late and i spent the whole
day in doing research for our project :)

Thanks
--Timothy

Christian W. Damus schrieb:
> Hi, Timothy,
>
> Find some replies in-line, below.
>
> HTH,
>
> Christian
>
>
> On Fri, 2008-06-13 at 15:35 +0200, Timothy Marc wrote:
>> Hello all,
>>
>> the last day, i've sniffered across the vast posssibilities in EMF to
>> validate models. I also read the great artcile of Christian Damus abaout
>> model integrity. Because of the complex topic, i'm a bit confused on how to
>> start with validation. I already know the OCL Spec and want it to use both
>> for model validation and code generation. First, let my summerize, whether
>> i've understand the main purpose of the topic.
>
> Thanks! I'm glad that you found the article helpful.
>
>> 1. The article of Christian deals with integrity of model, so that some
>> aspects are automatically generated. This has no relationship to the
>> validation framework, except that he also uses OCL, which is translated into
>> Java Code.
>
> Well, not exactly translated into Java code, but generating Java code
> that interprets the OCL. I think that's what you meant, anyway, but
> just to be clear ...
>
>
>> 2. The validation framework parses the m1 model, if the user triggers the
>> Validate button of the editor. With this functionality, it is possible to
>> validate against sophisticated constraints (such as XOR's between
>> associations), and not only against the simple required-constraint, for
>> instance.
> You mean, simple constraints like multiplicities? Right, the "batch
> model" validation of the Validation Framework component and the
> generated EValidator constraints are intended to check these kinds of
> more elaborate constraints.
>
>
>> 3. One should work with the OCL AST, if one want to generate, for instance,
>> body expressions in the code, which was generated from the ocl annotated m1
>> model. With the AST, it is possible to access the terminals of the
>> expression ond therefore, map the semantics of the ocl to the target
>> language of one's desire. (I'm going to use JET or JET2 for the generation
>> of code from my m1 model).
>
> Right. You might have a look at the proposal for the OCL Tools
> component of MDT and the initial contribution that accompanies it. This
> initial contribution includes an OCL-to-Java transformation. It is
> focused on generating pure Java implementations of OCL-specified
> constraints in an Ecore package. The question of analyzing the AST to
> determine which features should trigger constraints when they change was
> to come later in the plan.
>
>
>> So, may i have got the main purpose of these different approaches or am I
>> totally wrong?
>
> I don't think I followed exactly what the different approaches are. Do
> you mean, the distinction between static validation and dynamic
> (on-the-fly) validation? The EMF Validation Framework components does,
> also, implement the latter, especially in support of transaction
> validation in the EMF Transaction component. However, it doesn't make
> use of OCL AST analysis to determine trigger points for evaluation of
> constraints.
>
>
>> I think, especially the third point is quite complex. Does anyone know,
>> whether there is a tool outside, that mapps typical ocl constraints, to
>> programming language concept's?
>
> The OCL Tools component makes a start on this in its OCL-to-Java
> transformation, as I mentioned already.
>
>>
>> Thanks a lot for any information.
>>
>> Timothy
>>
>>
>>
Re: Validation of Meta- and Instance Models [message #419954 is a reply to message #419953] Sat, 14 June 2008 01:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-dSMfVIji36jNn+giyj2I
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Timothy,

More replies in-line.

cW

On Sat, 2008-06-14 at 00:01 +0200, Timothy Marc wrote:

> Dear Christian,
>
> thanks again. I haven't read your article till the end, i better should
> have read it, because, I mixed the EMF Validation approaches. After
> posting this message, i browsed through the Eclipse online help, where i
> found some furhter information concerning Validation.
>
> If i am correct, there are two validation concepts in EMF/EMFT. The
> Validation concept EMF cames with, is just a simple one, like you
> mentioned in your article. Easy to orchestrate and no need for a
> explicit constraint language. It also possible, to use Java code. I have
> found a really simple four-step-tutorial at EMF Framework -> EMF
> Validation Framework capabilities online at Eclipse help.


Yes. The "intrinsic" validation capability of EMF (based on the
EValidator/Diagnostician API) is, like everything else in the EMF core,
a generative approach. From any of these sources:

- Ecore model EOperations and EAnnotations,
- UML model Operations and Constraints, or
- Java interface methods and doc tags

You can generate constraint placeholders into your model classes and/or
validator class and fill them in with Java code. It's easy to use and
very good for defining constraints that are intrinsic to your model (as
no good or useful model is complete without its constraints).



> The main entry EMF Validation Framework is the one, you mentioned in the
> related resources in your article as EMFT Validation Framework, a more
> customer oriented approach, where one can use OCL too, if he wants.


Well, as the article shows, you can use OCL in generated EValidators,
too. :-) The mistaken reference to EMFT is, actually, historically
accurate. This component was originally released in the EMFT project
(as a spin-off from IBM's contribution of the GMF run-time), and moved
to EMF when the Modeling top-level project was created and EMFT took on
a formal role as the EMF incubator.



> Is this correct? And if not, what are the differences between the EMF
> Overview -> EMF Validation Framework and the main entry EMF Validation
> Framework Developers Guide. To me, it looks, as the included one is not
> so sophisticated, but only for checking m1 instances, when the user
> presses Validate. But what is the second one for?


The intrinsic generative approach to validation isn't less
sophisticated, but rather serves a different need. As I mentioned, it
is well suited to defining constraints that complete the definition of a
model. These are typically well-formed constraints that help the model
to work correctly.

The other component is targeted to applications that need to constrain
the usage of some common model for their own (domain-specific) purposes.
Thus, the constraints imposed externally by such applications tend not
to be of the well-formedness variety so much as the
readiness-for-the-application-to-consume-a-model variety. It also
provides a live validation mechanism that is used, for example, by the
Transaction component to implement validation in transactional editing.



> Hope, i'm writing not to confusing. It's very late and i spent the whole
> day in doing research for our project :)
>
> Thanks
> --Timothy
>
> Christian W. Damus schrieb:
> > Hi, Timothy,
> >
> > Find some replies in-line, below.
> >
> > HTH,
> >
> > Christian
> >
> >
> > On Fri, 2008-06-13 at 15:35 +0200, Timothy Marc wrote:
> >> Hello all,
> >>
> >> the last day, i've sniffered across the vast posssibilities in EMF to
> >> validate models. I also read the great artcile of Christian Damus abaout
> >> model integrity. Because of the complex topic, i'm a bit confused on how to
> >> start with validation. I already know the OCL Spec and want it to use both
> >> for model validation and code generation. First, let my summerize, whether
> >> i've understand the main purpose of the topic.
> >
> > Thanks! I'm glad that you found the article helpful.
> >
> >> 1. The article of Christian deals with integrity of model, so that some
> >> aspects are automatically generated. This has no relationship to the
> >> validation framework, except that he also uses OCL, which is translated into
> >> Java Code.
> >
> > Well, not exactly translated into Java code, but generating Java code
> > that interprets the OCL. I think that's what you meant, anyway, but
> > just to be clear ...
> >
> >
> >> 2. The validation framework parses the m1 model, if the user triggers the
> >> Validate button of the editor. With this functionality, it is possible to
> >> validate against sophisticated constraints (such as XOR's between
> >> associations), and not only against the simple required-constraint, for
> >> instance.
> > You mean, simple constraints like multiplicities? Right, the "batch
> > model" validation of the Validation Framework component and the
> > generated EValidator constraints are intended to check these kinds of
> > more elaborate constraints.
> >
> >
> >> 3. One should work with the OCL AST, if one want to generate, for instance,
> >> body expressions in the code, which was generated from the ocl annotated m1
> >> model. With the AST, it is possible to access the terminals of the
> >> expression ond therefore, map the semantics of the ocl to the target
> >> language of one's desire. (I'm going to use JET or JET2 for the generation
> >> of code from my m1 model).
> >
> > Right. You might have a look at the proposal for the OCL Tools
> > component of MDT and the initial contribution that accompanies it. This
> > initial contribution includes an OCL-to-Java transformation. It is
> > focused on generating pure Java implementations of OCL-specified
> > constraints in an Ecore package. The question of analyzing the AST to
> > determine which features should trigger constraints when they change was
> > to come later in the plan.
> >
> >
> >> So, may i have got the main purpose of these different approaches or am I
> >> totally wrong?
> >
> > I don't think I followed exactly what the different approaches are. Do
> > you mean, the distinction between static validation and dynamic
> > (on-the-fly) validation? The EMF Validation Framework components does,
> > also, implement the latter, especially in support of transaction
> > validation in the EMF Transaction component. However, it doesn't make
> > use of OCL AST analysis to determine trigger points for evaluation of
> > constraints.
> >
> >
> >> I think, especially the third point is quite complex. Does anyone know,
> >> whether there is a tool outside, that mapps typical ocl constraints, to
> >> programming language concept's?
> >
> > The OCL Tools component makes a start on this in its OCL-to-Java
> > transformation, as I mentioned already.
> >
> >>
> >> Thanks a lot for any information.
> >>
> >> Timothy
> >>
> >>
> >>

--=-dSMfVIji36jNn+giyj2I
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Timothy,<BR>
<BR>
More replies in-line.<BR>
<BR>
cW<BR>
<BR>
On Sat, 2008-06-14 at 00:01 +0200, Timothy Marc wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Dear Christian,</FONT>

<FONT COLOR="#000000">thanks again. I haven't read your article till the end, i better should </FONT>
<FONT COLOR="#000000">have read it, because, I mixed the EMF Validation approaches. After </FONT>
<FONT COLOR="#000000">posting this message, i browsed through the Eclipse online help, where i </FONT>
<FONT COLOR="#000000">found some furhter information concerning Validation.</FONT>

<FONT COLOR="#000000">If i am correct, there are two validation concepts in EMF/EMFT. The </FONT>
<FONT COLOR="#000000">Validation concept EMF cames with, is just a simple one, like you </FONT>
<FONT COLOR="#000000">mentioned in your article. Easy to orchestrate and no need for a </FONT>
<FONT COLOR="#000000">explicit constraint language. It also possible, to use Java code. I have </FONT>
<FONT COLOR="#000000">found a really simple four-step-tutorial at EMF Framework -&gt; EMF </FONT>
<FONT COLOR="#000000">Validation Framework capabilities online at Eclipse help.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Yes.&nbsp; The &quot;intrinsic&quot; validation capability of EMF (based on the EValidator/Diagnostician API) is, like everything else in the EMF core, a generative approach.&nbsp; From any of these sources:<BR>
<BR>
&nbsp; - Ecore model EOperations and EAnnotations,<BR>
&nbsp; - UML model Operations and Constraints, or<BR>
&nbsp; - Java interface methods and doc tags<BR>
<BR>
You can generate constraint placeholders into your model classes and/or validator class and fill them in with Java code.&nbsp; It's easy to use and very good for defining constraints that are intrinsic to your model (as no good or useful model is complete without its constraints).
<PRE>

</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">The main entry EMF Validation Framework is the one, you mentioned in the </FONT>
<FONT COLOR="#000000">related resources in your article as EMFT Validation Framework, a more </FONT>
<FONT COLOR="#000000">customer oriented approach, where one can use OCL too, if he wants.</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
Well, as the article shows, you can use OCL in generated EValidators, too.&nbsp; :-)&nbsp; The mistaken reference to EMFT is, actually, historically accurate.&nbsp; This component was originally released in the EMFT project (as a spin-off from IBM's contribution of the GMF run-time), and moved to EMF when the Modeling top-level project was created and EMFT took on a formal role as the EMF incubator.
<PRE>

</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Is this correct? And if not, what are the differences between the EMF </FONT>
<FONT COLOR="#000000">Overview -&gt; EMF Validation Framework and the main entry EMF Validation </FONT>
<FONT COLOR="#000000">Framework Developers Guide. To me, it looks, as the included one is not </FONT>
<FONT COLOR="#000000">so sophisticated, but only for checking m1 instances, when the user </FONT>
<FONT COLOR="#000000">presses Validate. But what is the second one for?</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
The intrinsic generative approach to validation isn't less sophisticated, but rather serves a different need.&nbsp; As I mentioned, it is well suited to defining constraints that complete the definition of a model.&nbsp; These are typically well-formed constraints that help the model to work correctly.<BR>
<BR>
The other component is targeted to applications that need to constrain the usage of some common model for their own (domain-specific) purposes.&nbsp; Thus, the constraints imposed externally by such applications tend not to be of the well-formedness variety so much as the readiness-for-the-application-to-consume-a-model variety.&nbsp; It also provides a live validation mechanism that is used, for example, by the Transaction component to implement validation in transactional editing.
<PRE>

</PRE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hope, i'm writing not to confusing. It's very late and i spent the whole </FONT>
<FONT COLOR="#000000">day in doing research for our project :)</FONT>

<FONT COLOR="#000000">Thanks</FONT>
<FONT COLOR="#000000">--Timothy</FONT>

<FONT COLOR="#000000">Christian W. Damus schrieb:</FONT>
<FONT COLOR="#000000">&gt; Hi, Timothy,</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Find some replies in-line, below.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; HTH,</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Christian</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; On Fri, 2008-06-13 at 15:35 +0200, Timothy Marc wrote:</FONT>
<FONT COLOR="#000000">&gt;&gt; Hello all,</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; the last day, i've sniffered across the vast posssibilities in EMF to </FONT>
<FONT COLOR="#000000">&gt;&gt; validate models. I also read the great artcile of Christian Damus abaout </FONT>
<FONT COLOR="#000000">&gt;&gt; model integrity. Because of the complex topic, i'm a bit confused on how to </FONT>
<FONT COLOR="#000000">&gt;&gt; start with validation. I already know the OCL Spec and want it to use both </FONT>
<FONT COLOR="#000000">&gt;&gt; for model validation and code generation. First, let my summerize, whether </FONT>
<FONT COLOR="#000000">&gt;&gt; i've understand the main purpose of the topic.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Thanks! I'm glad that you found the article helpful.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; 1. The article of Christian deals with integrity of model, so that some </FONT>
<FONT COLOR="#000000">&gt;&gt; aspects are automatically generated. This has no relationship to the </FONT>
<FONT COLOR="#000000">&gt;&gt; validation framework, except that he also uses OCL, which is translated into </FONT>
<FONT COLOR="#000000">&gt;&gt; Java Code.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Well, not exactly translated into Java code, but generating Java code </FONT>
<FONT COLOR="#000000">&gt; that interprets the OCL. I think that's what you meant, anyway, but </FONT>
<FONT COLOR="#000000">&gt; just to be clear ...</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; 2. The validation framework parses the m1 model, if the user triggers the </FONT>
<FONT COLOR="#000000">&gt;&gt; Validate button of the editor. With this functionality, it is possible to </FONT>
<FONT COLOR="#000000">&gt;&gt; validate against sophisticated constraints (such as XOR's between </FONT>
<FONT COLOR="#000000">&gt;&gt; associations), and not only against the simple required-constraint, for </FONT>
<FONT COLOR="#000000">&gt;&gt; instance.</FONT>
<FONT COLOR="#000000">&gt; You mean, simple constraints like multiplicities? Right, the &quot;batch </FONT>
<FONT COLOR="#000000">&gt; model&quot; validation of the Validation Framework component and the </FONT>
<FONT COLOR="#000000">&gt; generated EValidator constraints are intended to check these kinds of </FONT>
<FONT COLOR="#000000">&gt; more elaborate constraints.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; 3. One should work with the OCL AST, if one want to generate, for instance, </FONT>
<FONT COLOR="#000000">&gt;&gt; body expressions in the code, which was generated from the ocl annotated m1 </FONT>
<FONT COLOR="#000000">&gt;&gt; model. With the AST, it is possible to access the terminals of the </FONT>
<FONT COLOR="#000000">&gt;&gt; expression ond therefore, map the semantics of the ocl to the target </FONT>
<FONT COLOR="#000000">&gt;&gt; language of one's desire. (I'm going to use JET or JET2 for the generation </FONT>
<FONT COLOR="#000000">&gt;&gt; of code from my m1 model).</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; Right. You might have a look at the proposal for the OCL Tools </FONT>
<FONT COLOR="#000000">&gt; component of MDT and the initial contribution that accompanies it. This </FONT>
<FONT COLOR="#000000">&gt; initial contribution includes an OCL-to-Java transformation. It is </FONT>
<FONT COLOR="#000000">&gt; focused on generating pure Java implementations of OCL-specified </FONT>
<FONT COLOR="#000000">&gt; constraints in an Ecore package. The question of analyzing the AST to </FONT>
<FONT COLOR="#000000">&gt; determine which features should trigger constraints when they change was </FONT>
<FONT COLOR="#000000">&gt; to come later in the plan.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; So, may i have got the main purpose of these different approaches or am I </FONT>
<FONT COLOR="#000000">&gt;&gt; totally wrong?</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; I don't think I followed exactly what the different approaches are. Do </FONT>
<FONT COLOR="#000000">&gt; you mean, the distinction between static validation and dynamic </FONT>
<FONT COLOR="#000000">&gt; (on-the-fly) validation? The EMF Validation Framework components does, </FONT>
<FONT COLOR="#000000">&gt; also, implement the latter, especially in support of transaction </FONT>
<FONT COLOR="#000000">&gt; validation in the EMF Transaction component. However, it doesn't make </FONT>
<FONT COLOR="#000000">&gt; use of OCL AST analysis to determine trigger points for evaluation of </FONT>
<FONT COLOR="#000000">&gt; constraints.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; I think, especially the third point is quite complex. Does anyone know, </FONT>
<FONT COLOR="#000000">&gt;&gt; whether there is a tool outside, that mapps typical ocl constraints, to </FONT>
<FONT COLOR="#000000">&gt;&gt; programming language concept's?</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt; The OCL Tools component makes a start on this in its OCL-to-Java </FONT>
<FONT COLOR="#000000">&gt; transformation, as I mentioned already.</FONT>
<FONT COLOR="#000000">&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Thanks a lot for any information.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Timothy</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-dSMfVIji36jNn+giyj2I--
Re: Validation of Meta- and Instance Models [message #419957 is a reply to message #419954] Sat, 14 June 2008 06:44 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hey Christian,

thanks again for your explanations. Now i think i'm ready to dig deeper
into it, first referencing and exploring the intrinsic one, and
afterwards switching to the other, external Validation.

Thanks a lot.

Timothy

Christian W. Damus schrieb:
> Hi, Timothy,
>
> More replies in-line.
>
> cW
>
> On Sat, 2008-06-14 at 00:01 +0200, Timothy Marc wrote:
>> Dear Christian,
>>
>> thanks again. I haven't read your article till the end, i better should
>> have read it, because, I mixed the EMF Validation approaches. After
>> posting this message, i browsed through the Eclipse online help, where i
>> found some furhter information concerning Validation.
>>
>> If i am correct, there are two validation concepts in EMF/EMFT. The
>> Validation concept EMF cames with, is just a simple one, like you
>> mentioned in your article. Easy to orchestrate and no need for a
>> explicit constraint language. It also possible, to use Java code. I have
>> found a really simple four-step-tutorial at EMF Framework -> EMF
>> Validation Framework capabilities online at Eclipse help.
>
> Yes. The "intrinsic" validation capability of EMF (based on the
> EValidator/Diagnostician API) is, like everything else in the EMF core,
> a generative approach. From any of these sources:
>
> - Ecore model EOperations and EAnnotations,
> - UML model Operations and Constraints, or
> - Java interface methods and doc tags
>
> You can generate constraint placeholders into your model classes and/or
> validator class and fill them in with Java code. It's easy to use and
> very good for defining constraints that are intrinsic to your model (as
> no good or useful model is complete without its constraints).
>
>
>> The main entry EMF Validation Framework is the one, you mentioned in the
>> related resources in your article as EMFT Validation Framework, a more
>> customer oriented approach, where one can use OCL too, if he wants.
>
> Well, as the article shows, you can use OCL in generated EValidators,
> too. :-) The mistaken reference to EMFT is, actually, historically
> accurate. This component was originally released in the EMFT project
> (as a spin-off from IBM's contribution of the GMF run-time), and moved
> to EMF when the Modeling top-level project was created and EMFT took on
> a formal role as the EMF incubator.
>
>
>> Is this correct? And if not, what are the differences between the EMF
>> Overview -> EMF Validation Framework and the main entry EMF Validation
>> Framework Developers Guide. To me, it looks, as the included one is not
>> so sophisticated, but only for checking m1 instances, when the user
>> presses Validate. But what is the second one for?
>
> The intrinsic generative approach to validation isn't less
> sophisticated, but rather serves a different need. As I mentioned, it
> is well suited to defining constraints that complete the definition of a
> model. These are typically well-formed constraints that help the model
> to work correctly.
>
> The other component is targeted to applications that need to constrain
> the usage of some common model for their own (domain-specific)
> purposes. Thus, the constraints imposed externally by such applications
> tend not to be of the well-formedness variety so much as the
> readiness-for-the-application-to-consume-a-model variety. It also
> provides a live validation mechanism that is used, for example, by the
> Transaction component to implement validation in transactional editing.
>
>
>> Hope, i'm writing not to confusing. It's very late and i spent the whole
>> day in doing research for our project :)
>>
>> Thanks
>> --Timothy
>>
>> Christian W. Damus schrieb:
>> > Hi, Timothy,
>> >
>> > Find some replies in-line, below.
>> >
>> > HTH,
>> >
>> > Christian
>> >
>> >
>> > On Fri, 2008-06-13 at 15:35 +0200, Timothy Marc wrote:
>> >> Hello all,
>> >>
>> >> the last day, i've sniffered across the vast posssibilities in EMF to
>> >> validate models. I also read the great artcile of Christian Damus abaout
>> >> model integrity. Because of the complex topic, i'm a bit confused on how to
>> >> start with validation. I already know the OCL Spec and want it to use both
>> >> for model validation and code generation. First, let my summerize, whether
>> >> i've understand the main purpose of the topic.
>> >
>> > Thanks! I'm glad that you found the article helpful.
>> >
>> >> 1. The article of Christian deals with integrity of model, so that some
>> >> aspects are automatically generated. This has no relationship to the
>> >> validation framework, except that he also uses OCL, which is translated into
>> >> Java Code.
>> >
>> > Well, not exactly translated into Java code, but generating Java code
>> > that interprets the OCL. I think that's what you meant, anyway, but
>> > just to be clear ...
>> >
>> >
>> >> 2. The validation framework parses the m1 model, if the user triggers the
>> >> Validate button of the editor. With this functionality, it is possible to
>> >> validate against sophisticated constraints (such as XOR's between
>> >> associations), and not only against the simple required-constraint, for
>> >> instance.
>> > You mean, simple constraints like multiplicities? Right, the "batch
>> > model" validation of the Validation Framework component and the
>> > generated EValidator constraints are intended to check these kinds of
>> > more elaborate constraints.
>> >
>> >
>> >> 3. One should work with the OCL AST, if one want to generate, for instance,
>> >> body expressions in the code, which was generated from the ocl annotated m1
>> >> model. With the AST, it is possible to access the terminals of the
>> >> expression ond therefore, map the semantics of the ocl to the target
>> >> language of one's desire. (I'm going to use JET or JET2 for the generation
>> >> of code from my m1 model).
>> >
>> > Right. You might have a look at the proposal for the OCL Tools
>> > component of MDT and the initial contribution that accompanies it. This
>> > initial contribution includes an OCL-to-Java transformation. It is
>> > focused on generating pure Java implementations of OCL-specified
>> > constraints in an Ecore package. The question of analyzing the AST to
>> > determine which features should trigger constraints when they change was
>> > to come later in the plan.
>> >
>> >
>> >> So, may i have got the main purpose of these different approaches or am I
>> >> totally wrong?
>> >
>> > I don't think I followed exactly what the different approaches are. Do
>> > you mean, the distinction between static validation and dynamic
>> > (on-the-fly) validation? The EMF Validation Framework components does,
>> > also, implement the latter, especially in support of transaction
>> > validation in the EMF Transaction component. However, it doesn't make
>> > use of OCL AST analysis to determine trigger points for evaluation of
>> > constraints.
>> >
>> >
>> >> I think, especially the third point is quite complex. Does anyone know,
>> >> whether there is a tool outside, that mapps typical ocl constraints, to
>> >> programming language concept's?
>> >
>> > The OCL Tools component makes a start on this in its OCL-to-Java
>> > transformation, as I mentioned already.
>> >
>> >>
>> >> Thanks a lot for any information.
>> >>
>> >> Timothy
>> >>
>> >>
>> >>
Previous Topic:Examples of EMF reflective API
Next Topic:Finding a specialization of a modeled class?
Goto Forum:
  


Current Time: Thu Apr 25 09:47:40 GMT 2024

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

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

Back to the top