[Seaside] object validation pattern?

Chris Muller asqueaker at gmail.com
Mon Oct 15 16:15:48 UTC 2012


The answer depends on why you want to validate.  I tend to want to
make validation as late and lazy as possible.  For example, have you
ever used one of those UI's where, when try to tab off a field and it
won't let you because it says "Required" or "Invalid format".  That
approach is wrong.  :)

For implementation just use good ol'e exception handling in select
places (usually pretty high up).  That leaves the vast majority of the
code clean and unburdened by exception-handling/validation code.



On Mon, Oct 15, 2012 at 9:39 AM, sergio_101 <sergio.rrd at gmail.com> wrote:
> hey, all..
>
> i was wondering what the current best practice is for handling object
> validation..
>
> how do we define if an object is valid, and if not, what happens to
> that object?
>
> with my current day job framework, the validity of an item is directly
> tied to the model. if you try to save an invalid object, it fails.
>
> i know we can use magritte for this,  but this seems a little heavy
> weight of a solution for something i need at all times.
>
> is there a best practice or anything on how to handle this?
>
> thanks!
>
> --
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> http://www.ThoseOptimizeGuys.com
> http://www.CodingForHire.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


More information about the seaside mailing list