Re: Wich the best way to control the logic of a web application?

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Wich the best way to control the logic of a web application?
Дата
Msg-id 20090819170640.GV5407@samason.me.uk
обсуждение исходный текст
Ответ на Wich the best way to control the logic of a web application?  (Andre Lopes <lopes80andre@gmail.com>)
Список pgsql-general
On Wed, Aug 19, 2009 at 05:46:17PM +0100, Andre Lopes wrote:
> What do you think aboout this? Should I mix logic in Database and PHP or
> should I control the logic only in the PHP?

As always, it depends!  I tend to put things where ever it's most
convenient, however data integrity and other invariants within your
code will dictate some levels above which you can't place code.  In
your email address example before, this can easily be done in PHP (or
even JavaScript, client side) as the database doesn't care whether it's
getting a valid email address or not--it's just a character string
to the database.  To go to the other extreme, referential integrity
is (almost?) always best done inside the database as it has all the
information needed to do the right thing.

--
  Sam  http://samason.me.uk/

В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: question about /etc/init.d/postgresql in PGDG
Следующее
От: "Karsten Hilbert"
Дата:
Сообщение: Re: Unit conversion database (was: multiple paramters in aggregate function)