Re: Re: DRY for ActiveRecord w/PostgreSQL : defaults and validations

Nicholas Van Weerdenburg
Mon, 19 Sep 2005 12:29:53 -0000

On 9/19/05, Lugovoi Nikolai
<meadow.nnick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> Michael Schuerig wrote:
> > On Monday 19 September 2005 11:39, Lugovoi Nikolai wrote:
> >
> >>As for me it''s better to make one more constraint check
query to
> >>database than handling weird exception messages (or even exposing
> >>them to end users).
> >
> >
> > Before reinventing anything, have a look at
> >
> >   http://dev.rubyonrails.org/ticket/861
> >
> > Michael
> >
>
> Tnahks, but JS client-side validation can be bypassed, and server-side
> then is also required. And after all there are still schema constraints
> that DBMS has to check :)
>
> I wouldn''t rely on JS client-side validation, though it can be
more user
> friendly and use less traffic.
>
> WBR, Lugovoi Nikolai
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

There has been a few long threads on the philosophy of dbms
constraints versus application-logic constraints. IIRC correctly,
application-logic validation was the philosophical direction, being
DHH''s preference.

Part of the influence on this was, I think, MySQL''s only rather recent
support of constraints in the DBMS.

The other was that an OO domain model can be hard to constrain in a
RDMS constraint model.

Nick
--
Nicholas Van Weerdenburg