[Dbix-class] DBIx::Class, another data validation approach

Alexander Hartmaier alexander.hartmaier at t-systems.at
Thu Jul 23 12:28:35 GMT 2009


Am Dienstag, den 21.07.2009, 17:29 +0200 schrieb Ulrich Kautz:
> DBIx::Class::Validation
>
> PRO:
> + Very simple to use, a single module, no complex configuration (besides
> the validation profiles)..
> + Supports multiple validation modules (besides FormData::Validator)
>
> CONTRA:
> - Very "static", only one validation context (aka one filter profile)
> for each model is possible (or validation becomes again part of another
> layer, where you provide the profile definition)
> - Half way solution, columns and validation definition still separated
> - DRY philosophy not achieved, because inheritance of validation not given
> - No deflate / inflate awareness
>
I overcome some of your contra arguments by auto-generating the FVS
profile out of the column metadata.

Because DBIC 0.09 will have validation out-of-the-box because of Moose I
haven't invested any more work into making my module any better.

The DBMS validates data types, length, undef and foreign keys anyway, so
maybe using it as validator (parse its error messages) is a possibility?
>
> DBIx::Class::DataValidator
>
> PRO:
> + Multiple mergable validators supported for multiple contexts at
> runtime (create, update, customs.. )
> + Brings columns and validation together at definition time.
> + Better DRY support via named validation methods and column classes
> (inheritable)
> + Deflate / inflate aware
>
> CONTRA:
> - More complex usage, consists of two modules (ResultSet and Component),
> more settings (configuration) makes it less lighweight
> - Bound to Data::FormValidator
>
>
>
> Ulrich

--
BR Alex


*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*



More information about the DBIx-Class mailing list