MAValidatorVisitor>>visitToXRelation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MAValidatorVisitor>>visitToXRelation

NorbertHartl
Hi,

I wrote a few days ago having problems with validate.
The problem is that I have a form for an object which
has references to other objects. The problem for me
is that the validation traverses the whole tree of
objects being referenced. While this is good idea to
be sure the whole data setting is correct it is often
a bad idea in real life. Sometimes I need to create
an object upfront which doesn't validate only to
put this in a form afterwars for edition. But with
the current validation I can't do this.

I can't see the point why it should be necessary to check
everytime every object. As long as you have form entering
some data you only need to check what is being entered.
For a relation description the validateKind should be enough
because it is the constraint on the model.

Lukas, I saw you disabled the traversing for Single and Multiple-
Options. Is there any reason not doing this for the ToOne and
ToMany as well? I just removed the last line

self visit: self object description

from

MAValidatorVisitor>>visitToOneRelationDescription: aDescription

This prevents traversing but still checks for validateKind.

Any objections to remove this from Magritte?

Norbert


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: MAValidatorVisitor>>visitToXRelation

Lukas Renggli-2
> Lukas, I saw you disabled the traversing for Single and Multiple-
> Options.

Yep, since the option descriptions have fixed options anyway, it  
probably doesn't make sense to check them at all. This is the  
responsibility of the developer to get them right.

> Is there any reason not doing this for the ToOne and
> ToMany as well? I just removed the last line
>
> self visit: self object description
>
> from
>
> MAValidatorVisitor>>visitToOneRelationDescription: aDescription
>
> This prevents traversing but still checks for validateKind.
>
> Any objections to remove this from Magritte?

In most cases it probably doesn't make sense to traverse the graph.  
The only possible problem I see is when a to-one/to-many description  
is directly in-lined into the parent editor. I removed those lines  
for now and we will see if this turns out to be a problem. For me  
this is fine.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki