[html-formfu] DBIC::Validation::FormFu RFC & Element::Date patch

Zbigniew Lukasiak zzbbyy at gmail.com
Fri Oct 19 09:26:28 GMT 2007

On 10/18/07, Jonas Alves <jonas.alves at gmail.com> wrote:
> On 18/10/2007, Zbigniew Lukasiak <zzbbyy at gmail.com> wrote:
> > Hi Jonas,
> >
> > How about moving the the validation from the DB layer code into some
> > separate class in HTML::FormFu hierarchy?  I hate it when I have to
> > add things to the DB model that belong to the form layer this makes
> > the model coupled to the form - and I would rather have a clean model
> > independend on what form processing layer I use.
> >
> > Cheers,
> > Zbyszek
> >
> >
> Hi Zby,
> I don't know if I got it, but if you don't want the model and the form layer
> coupled then you don't need to do anything. Just validate with FormFu or
> your preferred validator first and then insert in the database like you
> usually do.
> On the other hand if you don't bother that they are coupled, you just need
> to call create or update on your resultset and the data is validated before
> being inserted. An exception with the form will be thrown if the data is not
> valid.

Ah - I thought you wrote the code to load the constraints from the
database - like the length of the varchars - and check it.


More information about the HTML-FormFu mailing list