cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hunsberger, Peter" <Peter.Hunsber...@stjude.org>
Subject RE: XMLForm & JSF
Date Tue, 08 Apr 2003 18:23:11 GMT
Bruno Dumon <bruno@outerthought.org> wrote:

<snip/>

> In my form-framework (the one of which I shared some ideas in 
> my earlier RT, I'm currently prototyping it to verify if it 
> makes sense), I see type conversion and validation as two 
> different steps; first try to convert string values to 
> number/date/whatever (of all fields), then do validation on them.

That makes sense, we sort of do both at once via hierarchical validation
rules; if one fails then it's children aren't run.  Thus we can check first
that a string is a valid date and if that succeeds we can then check (for
example) that the registration date is after the persons birth date.

> > So the question comes down to: is it necessary to perform 
> validation 
> > after/concurrent with model population?  I can see that in some 
> > frameworks you might want to do this in order to make sure 
> that valid 
> > values round trip back, but in our current framework that's not an 
> > issue (they come back via inspection of the aggregated 
> request data).  
> > I'd certainly rather be sure I'm dealing with valid values 
> when I go 
> > to populate a model, but then again, maybe that's just me.... ;-)
> 
> But here we got again the confusion between "form beans" and "model
> beans": the beans that struts/xmlform automatically populates 
> are not the "model beans", but just beans that temporarely 
> hold the form data until it's all validated.
> 
> At least this is the practice that is repeatedly described in 
> the struts manual and advocated on the struts mailing list. I 
> don't know how many people actually make this distinction in practice.

That makes some sense and it seems like it would allow Schematron to be
plugged in as well as any other validator.  However, you really don't want
to marshal the data to the bean and then unmarshal to XML/SAX just to run
the validator? I think you really want to have the capability to run
validation directly on the SAX stream before it gets marshaled into any
model?





Mime
View raw message