Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » TrackResources and Batch vs Live Validator
TrackResources and Batch vs Live Validator [message #485722] Mon, 14 September 2009 16:01 Go to next message
John J. Franey is currently offline John J. FraneyFriend
Messages: 31
Registered: July 2009
Member
In EMF validation framework 1.3.0, BatchValidator observes the
IBatchValidator.OPTION_TRACK_RESOURCES option that would generate 'marker
statuses for the resources covered by the validation operation'. These
are necessary to 'update problem markers'. Neat.

This option is not available on LiveValidator. Bummer.

Is it silly for me to expect LiveValidator to track resources? Is this a
reasonable enhancement request?

Do I need to write and register my own LiveValidator?

Regards,
Thanks,
John
Re: TrackResources and Batch vs Live Validator [message #485735 is a reply to message #485722] Mon, 14 September 2009 17:19 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

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

Hi, John,

The intention of the "live" validation was always to enable a
"transactional" editing system, by which I mean simply some kind of
automatic roll-back of changes performed during some interval. It is
not intended that problems caught by live validation should be persisted
in problem markers or by any other means. After all, once the offending
changes have been rolled back, there's no problem about which to persist
such information.

I wouldn't go so far as to say that tracking resources in the live
validator is "silly" but it does seem to indicate an unintended usage of
the API :-) I suppose there might be considerations such as efficiency
of UI refresh, etc. that could be accommodated by tracking resources ...
What are you trying to accomplish with this mechanism? Perhaps there's
an even better way.

You can, of course, always write your own validator if you need to, but
the intent is that you should never need to. That's why there isn't any
place to "register" them ;-)

HTH,

Christian


On Mon, 2009-09-14 at 16:01 +0000, John J. Franey wrote:

> In EMF validation framework 1.3.0, BatchValidator observes the
> IBatchValidator.OPTION_TRACK_RESOURCES option that would generate 'marker
> statuses for the resources covered by the validation operation'. These
> are necessary to 'update problem markers'. Neat.
>
> This option is not available on LiveValidator. Bummer.
>
> Is it silly for me to expect LiveValidator to track resources? Is this a
> reasonable enhancement request?
>
> Do I need to write and register my own LiveValidator?
>
> Regards,
> Thanks,
> John

--=-/dd2YxaJ1Bvh5VYT6oqg
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.24.1.1">
</HEAD>
<BODY>
Hi, John,<BR>
<BR>
The intention of the &quot;live&quot; validation was always to enable a &quot;transactional&quot; editing system, by which I mean simply some kind of automatic roll-back of changes performed during some interval.&nbsp; It is not intended that problems caught by live validation should be persisted in problem markers or by any other means.&nbsp; After all, once the offending changes have been rolled back, there's no problem about which to persist such information.<BR>
<BR>
I wouldn't go so far as to say that tracking resources in the live validator is &quot;silly&quot; but it does seem to indicate an unintended usage of the API&nbsp; :-)&nbsp; I suppose there might be considerations such as efficiency of UI refresh, etc. that could be accommodated by tracking resources ...&nbsp; What are you trying to accomplish with this mechanism?&nbsp; Perhaps there's an even better way.<BR>
<BR>
You can, of course, always write your own validator if you need to, but the intent is that you should never need to.&nbsp; That's why there isn't any place to &quot;register&quot; them&nbsp; ;-)<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Mon, 2009-09-14 at 16:01 +0000, John J. Franey wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
In EMF validation framework 1.3.0, BatchValidator observes the
IBatchValidator.OPTION_TRACK_RESOURCES option that would generate 'marker
statuses for the resources covered by the validation operation'. These
are necessary to 'update problem markers'. Neat.

This option is not available on LiveValidator. Bummer.

Is it silly for me to expect LiveValidator to track resources? Is this a
reasonable enhancement request?

Do I need to write and register my own LiveValidator?

Regards,
Thanks,
John
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-/dd2YxaJ1Bvh5VYT6oqg--
Re: TrackResources and Batch vs Live Validator [message #485743 is a reply to message #485735] Mon, 14 September 2009 18:24 Go to previous messageGo to next message
John J. Franey is currently offline John J. FraneyFriend
Messages: 31
Registered: July 2009
Member
Christian W. Damus wrote:

> Hi, John,
>
> The intention of the "live" validation was always to enable a
> "transactional" editing system, by which I mean simply some kind of
> automatic roll-back of changes performed during some interval. It is
> not intended that problems caught by live validation should be persisted
> in problem markers or by any other means. After all, once the offending
> changes have been rolled back, there's no problem about which to persist
> such information.
>

Thank you. I understand enough here that LiveValidation is not what I
want. I know that I am not building a 'transactional' editing system
because I don't even know what that is. I got down this path by
following the validation example for ext library model. From that
example, I could not tell that LiveValidation purpose is to enable a
transactional library editor. I guessed wrong.


> I wouldn't go so far as to say that tracking resources in the live
> validator is "silly" but it does seem to indicate an unintended usage of
> the API :-) I suppose there might be considerations such as efficiency
> of UI refresh, etc. that could be accommodated by tracking resources ...
> What are you trying to accomplish with this mechanism? Perhaps there's
> an even better way.

I now know there is a better way, thanks.

I'm looking for a poor man's builder for validation (or I want
to be convinced that I have to bite the bullet and write a builder).
I'm looking for the ability to validate and report errors as the user
enters content. This is a behavior that JDT gives: as the user enters
java code, the compiler runs (and gives error/problem messages). So,
I'm looking for that kind of interactive behavior.

I'm still new to plugin development and am reading code to discover the
right thing. Thanks for responding here to help me stay on track.

>
> You can, of course, always write your own validator if you need to, but
> the intent is that you should never need to. That's why there isn't any
> place to "register" them ;-)
>
> HTH,
>
> Christian
>

Thanks,
John

>
> On Mon, 2009-09-14 at 16:01 +0000, John J. Franey wrote:
>
>> In EMF validation framework 1.3.0, BatchValidator observes the
>> IBatchValidator.OPTION_TRACK_RESOURCES option that would generate 'marker
>> statuses for the resources covered by the validation operation'. These
>> are necessary to 'update problem markers'. Neat.
>>
>> This option is not available on LiveValidator. Bummer.
>>
>> Is it silly for me to expect LiveValidator to track resources? Is this a
>> reasonable enhancement request?
>>
>> Do I need to write and register my own LiveValidator?
>>
>> Regards,
>> Thanks,
>> John
Re: TrackResources and Batch vs Live Validator [message #485746 is a reply to message #485743] Mon, 14 September 2009 18:54 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

--=-ZUyKYxDZ/sIfDXy2rPas
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, John,

What I suggest for your case, then, is to use the Batch Validator.
Presumably there will be some heuristic to determine when (when does the
Java editor do its syntax validation, for example?). At the very least
your project builder would be driven by workspace resource changes.

If you're concerned about batch validation running a potentially
unbounded set of constraints and thereby reducing the responsiveness of
your editor, then you can look into using the IValidator
constraint-filter API to check some subset. One useful trick is to
include all of the constraints that you want to enable in the editor in
a particular categary for that purpose, and implement a filter to check
for that category (constraints can be members of multiple categories).

The problem with the Live Validator example is that it really wasn't
clear how it could demonstrate the notion of a "transaction" in a useful
way. One option would have been adding "Start" and "End" buttons to the
editor that would manually delineate the transaction boundaries.
Another option would have been to use the menu action invocation as the
transaction context, but all of the standard actions are pretty much
atomic changes anyway. Either approach would have been clunky, so we
left it very simple. Besides, the EMF Transaction component provides a
more complete example of live validation, so it didn't seem particularly
important ...

HTH,

Christian


On Mon, 2009-09-14 at 18:24 +0000, John J. Franey wrote:

> Christian W. Damus wrote:
>
> > Hi, John,
> >
> > The intention of the "live" validation was always to enable a
> > "transactional" editing system, by which I mean simply some kind of
> > automatic roll-back of changes performed during some interval. It is
> > not intended that problems caught by live validation should be persisted
> > in problem markers or by any other means. After all, once the offending
> > changes have been rolled back, there's no problem about which to persist
> > such information.
> >
>
> Thank you. I understand enough here that LiveValidation is not what I
> want. I know that I am not building a 'transactional' editing system
> because I don't even know what that is. I got down this path by
> following the validation example for ext library model. From that
> example, I could not tell that LiveValidation purpose is to enable a
> transactional library editor. I guessed wrong.
>
>
> > I wouldn't go so far as to say that tracking resources in the live
> > validator is "silly" but it does seem to indicate an unintended usage of
> > the API :-) I suppose there might be considerations such as efficiency
> > of UI refresh, etc. that could be accommodated by tracking resources ...
> > What are you trying to accomplish with this mechanism? Perhaps there's
> > an even better way.
>
> I now know there is a better way, thanks.
>
> I'm looking for a poor man's builder for validation (or I want
> to be convinced that I have to bite the bullet and write a builder).
> I'm looking for the ability to validate and report errors as the user
> enters content. This is a behavior that JDT gives: as the user enters
> java code, the compiler runs (and gives error/problem messages). So,
> I'm looking for that kind of interactive behavior.
>
> I'm still new to plugin development and am reading code to discover the
> right thing. Thanks for responding here to help me stay on track.
>
> >
> > You can, of course, always write your own validator if you need to, but
> > the intent is that you should never need to. That's why there isn't any
> > place to "register" them ;-)
> >
> > HTH,
> >
> > Christian
> >
>
> Thanks,
> John
>
> >
> > On Mon, 2009-09-14 at 16:01 +0000, John J. Franey wrote:
> >
> >> In EMF validation framework 1.3.0, BatchValidator observes the
> >> IBatchValidator.OPTION_TRACK_RESOURCES option that would generate 'marker
> >> statuses for the resources covered by the validation operation'. These
> >> are necessary to 'update problem markers'. Neat.
> >>
> >> This option is not available on LiveValidator. Bummer.
> >>
> >> Is it silly for me to expect LiveValidator to track resources? Is this a
> >> reasonable enhancement request?
> >>
> >> Do I need to write and register my own LiveValidator?
> >>
> >> Regards,
> >> Thanks,
> >> John
>

--=-ZUyKYxDZ/sIfDXy2rPas
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.24.1.1">
</HEAD>
<BODY>
Hi, John,<BR>
<BR>
What I suggest for your case, then, is to use the Batch Validator.&nbsp; Presumably there will be some heuristic to determine when (when does the Java editor do its syntax validation, for example?).&nbsp; At the very least your project builder would be driven by workspace resource changes.<BR>
<BR>
If you're concerned about batch validation running a potentially unbounded set of constraints and thereby reducing the responsiveness of your editor, then you can look into using the IValidator constraint-filter API to check some subset.&nbsp; One useful trick is to include all of the constraints that you want to enable in the editor in a particular categary for that purpose, and implement a filter to check for that category (constraints can be members of multiple categories).<BR>
<BR>
The problem with the Live Validator example is that it really wasn't clear how it could demonstrate the notion of a &quot;transaction&quot; in a useful way. One option would have been adding &quot;Start&quot; and &quot;End&quot; buttons to the editor that would manually delineate the transaction boundaries.&nbsp; Another option would have been to use the menu action invocation as the transaction context, but all of the standard actions are pretty much atomic changes anyway. Either approach would have been clunky, so we left it very simple.&nbsp; Besides, the EMF Transaction component provides a more complete example of live validation, so it didn't seem particularly important ...<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Mon, 2009-09-14 at 18:24 +0000, John J. Franey wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Christian W. Damus wrote:

&gt; Hi, John,
&gt;
&gt; The intention of the &quot;live&quot; validation was always to enable a
&gt; &quot;transactional&quot; editing system, by which I mean simply some kind of
&gt; automatic roll-back of changes performed during some interval. It is
&gt; not intended that problems caught by live validation should be persisted
&gt; in problem markers or by any other means. After all, once the offending
&gt; changes have been rolled back, there's no problem about which to persist
&gt; such information.
&gt;

Thank you. I understand enough here that LiveValidation is not what I
want. I know that I am not building a 'transactional' editing system
because I don't even know what that is. I got down this path by
following the validation example for ext library model. From that
example, I could not tell that LiveValidation purpose is to enable a
transactional library editor. I guessed wrong.


&gt; I wouldn't go so far as to say that tracking resources in the live
&gt; validator is &quot;silly&quot; but it does seem to indicate an unintended usage of
&gt; the API :-) I suppose there might be considerations such as efficiency
&gt; of UI refresh, etc. that could be accommodated by tracking resources ...
&gt; What are you trying to accomplish with this mechanism? Perhaps there's
&gt; an even better way.

I now know there is a better way, thanks.

I'm looking for a poor man's builder for validation (or I want
to be convinced that I have to bite the bullet and write a builder).
I'm looking for the ability to validate and report errors as the user
enters content. This is a behavior that JDT gives: as the user enters
java code, the compiler runs (and gives error/problem messages). So,
I'm looking for that kind of interactive behavior.

I'm still new to plugin development and am reading code to discover the
right thing. Thanks for responding here to help me stay on track.

&gt;
&gt; You can, of course, always write your own validator if you need to, but
&gt; the intent is that you should never need to. That's why there isn't any
&gt; place to &quot;register&quot; them ;-)
&gt;
&gt; HTH,
&gt;
&gt; Christian
&gt;

Thanks,
John

&gt;
&gt; On Mon, 2009-09-14 at 16:01 +0000, John J. Franey wrote:
&gt;
&gt;&gt; In EMF validation framework 1.3.0, BatchValidator observes the
&gt;&gt; IBatchValidator.OPTION_TRACK_RESOURCES option that would generate 'marker
&gt;&gt; statuses for the resources covered by the validation operation'. These
&gt;&gt; are necessary to 'update problem markers'. Neat.
&gt;&gt;
&gt;&gt; This option is not available on LiveValidator. Bummer.
&gt;&gt;
&gt;&gt; Is it silly for me to expect LiveValidator to track resources? Is this a
&gt;&gt; reasonable enhancement request?
&gt;&gt;
&gt;&gt; Do I need to write and register my own LiveValidator?
&gt;&gt;
&gt;&gt; Regards,
&gt;&gt; Thanks,
&gt;&gt; John

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

--=-ZUyKYxDZ/sIfDXy2rPas--
Previous Topic:extending eType(s)
Next Topic:Is there a way to extend EFactories?
Goto Forum:
  


Current Time: Thu Apr 25 07:08:28 GMT 2024

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

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

Back to the top