Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » 'Live' validation in EMF vs EMFT
'Live' validation in EMF vs EMFT [message #47216] Mon, 28 August 2006 14:32 Go to next message
Eclipse UserFriend
Originally posted by: runeedge.gmail.com

I have a question regarding 'live and batch validation.'

Before EMFT, these terms are not heard in the EMF. I'm rather new to
EMF and even more so with EMFT, however, it seems that 'live and batch
validation' are possible using the EMF, but if that is true, why would
they even bother 'adding' it to the EMFT. Furthermore, as I mentioned,
the terminology did not even exist in the EMF, which makes me think that
I must have missed something.

Using the EMF only, for example, we attach an adapter to some object;
say an integer with default value 0. When its changed, some function
stores the sum of a calculation there, the adapter can be made to call
the validation function. Correct? Then the validation says "ok, this
is within the bounds" or perhaps "error, you can't do that."

(For batch validation, you simply call Validate(); whenever you need to.
For example, if the user clicks on submit, we can run Validate() and
it would check to make sure all of the required fields had been filled
with data.)

Is that right, for Live and Batch validation using only EMF? Or perhaps
not? Assuming it is, using the EMF for validation seems more
convenient, because the EMF can generate validation tests as well as
adapters (or editable prototypes at least). However, as far as I have
seen, from the EMFT validation tutorials, the EMFT validation code
cannot be generated, it has to be written from scratch.

Other than that, which seems to be a disadvantage, EMFT validation seems
pretty similiar to EMF--but I don't think anyone would waste their time
reduplicating efforts to add validation to EMF.

So, assuming I've missed something, somewhere, which I'm sure I have,
where have I gone wrong? What advantage does the EMFT have over EMF?
Can one give senarios with EMFT validation and EMF validation?

I wrote a basic 'batch' validator on top of the EMF validation, and the
whole reason I'm arguing for this now is that we're trying to develop a
clean way to do 'live' validation (whether using EMF or EMFT).

I appreciate any comments, suggestions, or pointers to more information,
Tim
Re: 'Live' validation in EMF vs EMFT [message #47591 is a reply to message #47216] Tue, 29 August 2006 10:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Tim,

I think your understanding of EMF's validation capabilities is correct (or,
at least, is like my understanding, which doesn't necessarily imply
correctness).

I'm not sure that EMFT's validation doesn't support the generation of
validation constraints. For example, using OCL doesn't require writing any
Java code, and projects such as GMF are already generating the "glue" that
inserts OCL constraint definitions into EMFT validation.

The major practical distinction between EMF's validation and EMFT's is that
EMFT's framework is designed to support contribution of constraints to a
metamodel (or an application; viz. the "client context") by third parties.
The EMF approach builds the constraints directly into the metamodel. Of
course, a metamodel is not complete without constraints, but EMFT allows
consumers of a metamodel to layer their own business rules on top of the
metamodel constraints. Mechanisms such as client context and the
preference page also enable selection of a subset of the available
constraints on a per-application or per-user basis. EMFT does provide an
adapter to "call out" to EMF-defined constraints (see the "EMF Validation
Adapter" example in the EMFT Validation Examples).

EMFT's live validation support is quite a different matter from adapters
that check conditions. It is used in conjunction with a transaction model
(such as provided by the EMFT Transaction component) to validate a set of
changes performed during a transaction. The intent is that, if the changes
performed in a transaction violate sufficiently severe constraints ("error"
severity), then the transaction should be rolled back. The EMFT
Transaction API incorporates this capability by using a change recorder to
automatically record changes, validate them when the transaction is asked
to commit, and rolling the changes back if validation fails. EMFT
Validation's "live" mode of validation is not very useful without some such
transactional model in place, but could at least be used (as demonstrated
by one of the validation example plug-ins) to report problems on-the-fly.

HTH,

Christian


Tim Mahrt wrote:

> I have a question regarding 'live and batch validation.'
>
> Before EMFT, these terms are not heard in the EMF. I'm rather new to
> EMF and even more so with EMFT, however, it seems that 'live and batch
> validation' are possible using the EMF, but if that is true, why would
> they even bother 'adding' it to the EMFT. Furthermore, as I mentioned,
> the terminology did not even exist in the EMF, which makes me think that
> I must have missed something.
>
> Using the EMF only, for example, we attach an adapter to some object;
> say an integer with default value 0. When its changed, some function
> stores the sum of a calculation there, the adapter can be made to call
> the validation function. Correct? Then the validation says "ok, this
> is within the bounds" or perhaps "error, you can't do that."
>
> (For batch validation, you simply call Validate(); whenever you need to.
> For example, if the user clicks on submit, we can run Validate() and
> it would check to make sure all of the required fields had been filled
> with data.)
>
> Is that right, for Live and Batch validation using only EMF? Or perhaps
> not? Assuming it is, using the EMF for validation seems more
> convenient, because the EMF can generate validation tests as well as
> adapters (or editable prototypes at least). However, as far as I have
> seen, from the EMFT validation tutorials, the EMFT validation code
> cannot be generated, it has to be written from scratch.
>
> Other than that, which seems to be a disadvantage, EMFT validation seems
> pretty similiar to EMF--but I don't think anyone would waste their time
> reduplicating efforts to add validation to EMF.
>
> So, assuming I've missed something, somewhere, which I'm sure I have,
> where have I gone wrong? What advantage does the EMFT have over EMF?
> Can one give senarios with EMFT validation and EMF validation?
>
> I wrote a basic 'batch' validator on top of the EMF validation, and the
> whole reason I'm arguing for this now is that we're trying to develop a
> clean way to do 'live' validation (whether using EMF or EMFT).
>
> I appreciate any comments, suggestions, or pointers to more information,
> Tim
Re: 'Live' validation in EMF vs EMFT [message #47649 is a reply to message #47216] Tue, 29 August 2006 10:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi Tim,

EMFT validation has some features not found in EMF's validation framework.

First of all, the EMFT validation framework uses an extension point to
gather constraints that will be evaluated. This allows multiple clients
to contribute constraints for your EPackage and/or application.

The EMFT validation framework allows new constraint languages to be
independently added through an extension point (ie. constraintParsers).
For example, the validation SDK includes OCL support so that someone can
contribute a constraint that is defined using the OCL language against
the constraints extension point. We also support the "EMF" language so
that you can hook your existing EMF-style validate methods into the EMFT
validation framework.

Regarding your questions about live vs. batch validation. I suppose that
both are technically feasible in EMF's validation framework. In the case
of live validation, there is this problem of modeling objects going out
of a valid state only to be eventually placed back into a valid state.
The problem is that the level of a single notification it is too
granular in most cases (not in the simple case that you provided). So,
really the live validation aspect of EMFT's validation framework is
intended to be integrated into some form of a transaction.

You can take a look at the EMFT transaction API for an example of live
validation in action. At the end of a transaction live validation is run
in order to determine if the validity of the editing domain has been
compromised. If a live validation rule produces an error then the whole
transaction is rolled back with an error. This gives clients some
breathing room within the transaction to take objects in and out of a
valid state as long as everything is valid by the end of the transaction.

Another thing that is useful about EMFT's live validation constraints is
that you are provided with all of the notifications that constitute the
logical transaction that has taken place. The constraint can inspect
what happened to a particular object throughout the transaction in order
to determine success or failure. This is simply not possible using EMF's
EValidator API's because you provide the constraint only with the object
to be validated in its final state. There is no way to provide the
notifications that lead the object from its initial state to its final
state.

As part of the EMFT validation framework, we provide a preference page
in the UI that allows users to enable and disable certain constraints.
The preference page provides the user with the descriptions of the
constraints. Constraints can be "locked" if they must not be disabled.

I hope that this answers some of your questions,

Chris McGee

Tim Mahrt wrote:
> I have a question regarding 'live and batch validation.'
>
> Before EMFT, these terms are not heard in the EMF. I'm rather new to
> EMF and even more so with EMFT, however, it seems that 'live and batch
> validation' are possible using the EMF, but if that is true, why would
> they even bother 'adding' it to the EMFT. Furthermore, as I mentioned,
> the terminology did not even exist in the EMF, which makes me think that
> I must have missed something.
>
> Using the EMF only, for example, we attach an adapter to some object;
> say an integer with default value 0. When its changed, some function
> stores the sum of a calculation there, the adapter can be made to call
> the validation function. Correct? Then the validation says "ok, this
> is within the bounds" or perhaps "error, you can't do that."
>
> (For batch validation, you simply call Validate(); whenever you need to.
> For example, if the user clicks on submit, we can run Validate() and it
> would check to make sure all of the required fields had been filled with
> data.)
>
> Is that right, for Live and Batch validation using only EMF? Or perhaps
> not? Assuming it is, using the EMF for validation seems more
> convenient, because the EMF can generate validation tests as well as
> adapters (or editable prototypes at least). However, as far as I have
> seen, from the EMFT validation tutorials, the EMFT validation code
> cannot be generated, it has to be written from scratch.
>
> Other than that, which seems to be a disadvantage, EMFT validation seems
> pretty similiar to EMF--but I don't think anyone would waste their time
> reduplicating efforts to add validation to EMF.
>
> So, assuming I've missed something, somewhere, which I'm sure I have,
> where have I gone wrong? What advantage does the EMFT have over EMF?
> Can one give senarios with EMFT validation and EMF validation?
>
> I wrote a basic 'batch' validator on top of the EMF validation, and the
> whole reason I'm arguing for this now is that we're trying to develop a
> clean way to do 'live' validation (whether using EMF or EMFT).
>
> I appreciate any comments, suggestions, or pointers to more information,
> Tim
Re: 'Live' validation in EMF vs EMFT [message #47840 is a reply to message #47216] Tue, 29 August 2006 14:39 Go to previous message
Eclipse UserFriend
Originally posted by: runeedge.gmail.com

Chris and Christian,
Thank you very much for your responses. That was exactly what I was
looking for.

For my purposes, EMFT is probably above what I need, and I will just
stick with EMF, though I have the understanding now to use EMFT in the
future should I need it.

Thanks again!
Tim

Tim Mahrt wrote:
> I have a question regarding 'live and batch validation.'
>
> Before EMFT, these terms are not heard in the EMF. I'm rather new to
> EMF and even more so with EMFT, however, it seems that 'live and batch
> validation' are possible using the EMF, but if that is true, why would
> they even bother 'adding' it to the EMFT. Furthermore, as I mentioned,
> the terminology did not even exist in the EMF, which makes me think that
> I must have missed something.
>
> Using the EMF only, for example, we attach an adapter to some object;
> say an integer with default value 0. When its changed, some function
> stores the sum of a calculation there, the adapter can be made to call
> the validation function. Correct? Then the validation says "ok, this
> is within the bounds" or perhaps "error, you can't do that."
>
> (For batch validation, you simply call Validate(); whenever you need to.
> For example, if the user clicks on submit, we can run Validate() and it
> would check to make sure all of the required fields had been filled with
> data.)
>
> Is that right, for Live and Batch validation using only EMF? Or perhaps
> not? Assuming it is, using the EMF for validation seems more
> convenient, because the EMF can generate validation tests as well as
> adapters (or editable prototypes at least). However, as far as I have
> seen, from the EMFT validation tutorials, the EMFT validation code
> cannot be generated, it has to be written from scratch.
>
> Other than that, which seems to be a disadvantage, EMFT validation seems
> pretty similiar to EMF--but I don't think anyone would waste their time
> reduplicating efforts to add validation to EMF.
>
> So, assuming I've missed something, somewhere, which I'm sure I have,
> where have I gone wrong? What advantage does the EMFT have over EMF?
> Can one give senarios with EMFT validation and EMF validation?
>
> I wrote a basic 'batch' validator on top of the EMF validation, and the
> whole reason I'm arguing for this now is that we're trying to develop a
> clean way to do 'live' validation (whether using EMF or EMFT).
>
> I appreciate any comments, suggestions, or pointers to more information,
> Tim
Re: 'Live' validation in EMF vs EMFT [message #586757 is a reply to message #47216] Tue, 29 August 2006 10:26 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Tim,

I think your understanding of EMF's validation capabilities is correct (or,
at least, is like my understanding, which doesn't necessarily imply
correctness).

I'm not sure that EMFT's validation doesn't support the generation of
validation constraints. For example, using OCL doesn't require writing any
Java code, and projects such as GMF are already generating the "glue" that
inserts OCL constraint definitions into EMFT validation.

The major practical distinction between EMF's validation and EMFT's is that
EMFT's framework is designed to support contribution of constraints to a
metamodel (or an application; viz. the "client context") by third parties.
The EMF approach builds the constraints directly into the metamodel. Of
course, a metamodel is not complete without constraints, but EMFT allows
consumers of a metamodel to layer their own business rules on top of the
metamodel constraints. Mechanisms such as client context and the
preference page also enable selection of a subset of the available
constraints on a per-application or per-user basis. EMFT does provide an
adapter to "call out" to EMF-defined constraints (see the "EMF Validation
Adapter" example in the EMFT Validation Examples).

EMFT's live validation support is quite a different matter from adapters
that check conditions. It is used in conjunction with a transaction model
(such as provided by the EMFT Transaction component) to validate a set of
changes performed during a transaction. The intent is that, if the changes
performed in a transaction violate sufficiently severe constraints ("error"
severity), then the transaction should be rolled back. The EMFT
Transaction API incorporates this capability by using a change recorder to
automatically record changes, validate them when the transaction is asked
to commit, and rolling the changes back if validation fails. EMFT
Validation's "live" mode of validation is not very useful without some such
transactional model in place, but could at least be used (as demonstrated
by one of the validation example plug-ins) to report problems on-the-fly.

HTH,

Christian


Tim Mahrt wrote:

> I have a question regarding 'live and batch validation.'
>
> Before EMFT, these terms are not heard in the EMF. I'm rather new to
> EMF and even more so with EMFT, however, it seems that 'live and batch
> validation' are possible using the EMF, but if that is true, why would
> they even bother 'adding' it to the EMFT. Furthermore, as I mentioned,
> the terminology did not even exist in the EMF, which makes me think that
> I must have missed something.
>
> Using the EMF only, for example, we attach an adapter to some object;
> say an integer with default value 0. When its changed, some function
> stores the sum of a calculation there, the adapter can be made to call
> the validation function. Correct? Then the validation says "ok, this
> is within the bounds" or perhaps "error, you can't do that."
>
> (For batch validation, you simply call Validate(); whenever you need to.
> For example, if the user clicks on submit, we can run Validate() and
> it would check to make sure all of the required fields had been filled
> with data.)
>
> Is that right, for Live and Batch validation using only EMF? Or perhaps
> not? Assuming it is, using the EMF for validation seems more
> convenient, because the EMF can generate validation tests as well as
> adapters (or editable prototypes at least). However, as far as I have
> seen, from the EMFT validation tutorials, the EMFT validation code
> cannot be generated, it has to be written from scratch.
>
> Other than that, which seems to be a disadvantage, EMFT validation seems
> pretty similiar to EMF--but I don't think anyone would waste their time
> reduplicating efforts to add validation to EMF.
>
> So, assuming I've missed something, somewhere, which I'm sure I have,
> where have I gone wrong? What advantage does the EMFT have over EMF?
> Can one give senarios with EMFT validation and EMF validation?
>
> I wrote a basic 'batch' validator on top of the EMF validation, and the
> whole reason I'm arguing for this now is that we're trying to develop a
> clean way to do 'live' validation (whether using EMF or EMFT).
>
> I appreciate any comments, suggestions, or pointers to more information,
> Tim
Re: 'Live' validation in EMF vs EMFT [message #586780 is a reply to message #47216] Tue, 29 August 2006 10:54 Go to previous message
Eclipse UserFriend
Hi Tim,

EMFT validation has some features not found in EMF's validation framework.

First of all, the EMFT validation framework uses an extension point to
gather constraints that will be evaluated. This allows multiple clients
to contribute constraints for your EPackage and/or application.

The EMFT validation framework allows new constraint languages to be
independently added through an extension point (ie. constraintParsers).
For example, the validation SDK includes OCL support so that someone can
contribute a constraint that is defined using the OCL language against
the constraints extension point. We also support the "EMF" language so
that you can hook your existing EMF-style validate methods into the EMFT
validation framework.

Regarding your questions about live vs. batch validation. I suppose that
both are technically feasible in EMF's validation framework. In the case
of live validation, there is this problem of modeling objects going out
of a valid state only to be eventually placed back into a valid state.
The problem is that the level of a single notification it is too
granular in most cases (not in the simple case that you provided). So,
really the live validation aspect of EMFT's validation framework is
intended to be integrated into some form of a transaction.

You can take a look at the EMFT transaction API for an example of live
validation in action. At the end of a transaction live validation is run
in order to determine if the validity of the editing domain has been
compromised. If a live validation rule produces an error then the whole
transaction is rolled back with an error. This gives clients some
breathing room within the transaction to take objects in and out of a
valid state as long as everything is valid by the end of the transaction.

Another thing that is useful about EMFT's live validation constraints is
that you are provided with all of the notifications that constitute the
logical transaction that has taken place. The constraint can inspect
what happened to a particular object throughout the transaction in order
to determine success or failure. This is simply not possible using EMF's
EValidator API's because you provide the constraint only with the object
to be validated in its final state. There is no way to provide the
notifications that lead the object from its initial state to its final
state.

As part of the EMFT validation framework, we provide a preference page
in the UI that allows users to enable and disable certain constraints.
The preference page provides the user with the descriptions of the
constraints. Constraints can be "locked" if they must not be disabled.

I hope that this answers some of your questions,

Chris McGee

Tim Mahrt wrote:
> I have a question regarding 'live and batch validation.'
>
> Before EMFT, these terms are not heard in the EMF. I'm rather new to
> EMF and even more so with EMFT, however, it seems that 'live and batch
> validation' are possible using the EMF, but if that is true, why would
> they even bother 'adding' it to the EMFT. Furthermore, as I mentioned,
> the terminology did not even exist in the EMF, which makes me think that
> I must have missed something.
>
> Using the EMF only, for example, we attach an adapter to some object;
> say an integer with default value 0. When its changed, some function
> stores the sum of a calculation there, the adapter can be made to call
> the validation function. Correct? Then the validation says "ok, this
> is within the bounds" or perhaps "error, you can't do that."
>
> (For batch validation, you simply call Validate(); whenever you need to.
> For example, if the user clicks on submit, we can run Validate() and it
> would check to make sure all of the required fields had been filled with
> data.)
>
> Is that right, for Live and Batch validation using only EMF? Or perhaps
> not? Assuming it is, using the EMF for validation seems more
> convenient, because the EMF can generate validation tests as well as
> adapters (or editable prototypes at least). However, as far as I have
> seen, from the EMFT validation tutorials, the EMFT validation code
> cannot be generated, it has to be written from scratch.
>
> Other than that, which seems to be a disadvantage, EMFT validation seems
> pretty similiar to EMF--but I don't think anyone would waste their time
> reduplicating efforts to add validation to EMF.
>
> So, assuming I've missed something, somewhere, which I'm sure I have,
> where have I gone wrong? What advantage does the EMFT have over EMF?
> Can one give senarios with EMFT validation and EMF validation?
>
> I wrote a basic 'batch' validator on top of the EMF validation, and the
> whole reason I'm arguing for this now is that we're trying to develop a
> clean way to do 'live' validation (whether using EMF or EMFT).
>
> I appreciate any comments, suggestions, or pointers to more information,
> Tim
Re: 'Live' validation in EMF vs EMFT [message #586869 is a reply to message #47216] Tue, 29 August 2006 14:39 Go to previous message
Eclipse UserFriend
Originally posted by: runeedge.gmail.com

Chris and Christian,
Thank you very much for your responses. That was exactly what I was
looking for.

For my purposes, EMFT is probably above what I need, and I will just
stick with EMF, though I have the understanding now to use EMFT in the
future should I need it.

Thanks again!
Tim

Tim Mahrt wrote:
> I have a question regarding 'live and batch validation.'
>
> Before EMFT, these terms are not heard in the EMF. I'm rather new to
> EMF and even more so with EMFT, however, it seems that 'live and batch
> validation' are possible using the EMF, but if that is true, why would
> they even bother 'adding' it to the EMFT. Furthermore, as I mentioned,
> the terminology did not even exist in the EMF, which makes me think that
> I must have missed something.
>
> Using the EMF only, for example, we attach an adapter to some object;
> say an integer with default value 0. When its changed, some function
> stores the sum of a calculation there, the adapter can be made to call
> the validation function. Correct? Then the validation says "ok, this
> is within the bounds" or perhaps "error, you can't do that."
>
> (For batch validation, you simply call Validate(); whenever you need to.
> For example, if the user clicks on submit, we can run Validate() and it
> would check to make sure all of the required fields had been filled with
> data.)
>
> Is that right, for Live and Batch validation using only EMF? Or perhaps
> not? Assuming it is, using the EMF for validation seems more
> convenient, because the EMF can generate validation tests as well as
> adapters (or editable prototypes at least). However, as far as I have
> seen, from the EMFT validation tutorials, the EMFT validation code
> cannot be generated, it has to be written from scratch.
>
> Other than that, which seems to be a disadvantage, EMFT validation seems
> pretty similiar to EMF--but I don't think anyone would waste their time
> reduplicating efforts to add validation to EMF.
>
> So, assuming I've missed something, somewhere, which I'm sure I have,
> where have I gone wrong? What advantage does the EMFT have over EMF?
> Can one give senarios with EMFT validation and EMF validation?
>
> I wrote a basic 'batch' validator on top of the EMF validation, and the
> whole reason I'm arguing for this now is that we're trying to develop a
> clean way to do 'live' validation (whether using EMF or EMFT).
>
> I appreciate any comments, suggestions, or pointers to more information,
> Tim
Previous Topic:cdo and linux error
Next Topic:Need OCL help
Goto Forum:
  


Current Time: Thu May 08 09:06:14 EDT 2025

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

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

Back to the top