In data-intensive applications, we would try to move all of our
validation into our models or business delegates.
In general, our controller updates the model with changes from the UI
components. If there is a validation error then an exception is
thrown. The controller can catch the exception and set an errorString
on the component that caused the update. The error message can come
from the Error object, or from a hash table, key'd by the Error type
or by an identifier in the Error object.
This architecture means that validation for one piece of data is
performed where it is stored and never duplicated, and it guarantees
that our models can only contain valid data.
Peter
On 10/9/06, Howard Treisman <[EMAIL PROTECTED]> wrote:
> Hi
>
> I'm hitting what I can only imagine is a very common problem:
> Every time I put a component on a form, I have to write several
> validators for the component. There is more validator code than
> component code.
>
> Does anyone know of any sub-classes of the standard components that
> add a level of validation directly within the class, but embedding
> some standard validators in the class? These validators would then be
> simply turned on and off by simple attributes in the mxml.
>
> Sample code, or a pointer to an open source (or commercial) library
> would be much appreciated.
>
> Thanks,
> Howard
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcomponents/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcomponents/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/