![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.php archiveRe: Abstracting a database class
From: Chung Leong <chernyshevsky@hotmail.com>
Date: Wed Jan 04 2006 - 02:59:49 CET
Full Decent wrote:
It's just a matter of separating the concerns of your code. Doesn't
$message = GetMessageById($id);
or
$message = GetMessageByTitle($title);
or
$messages = GetMessagesByDate($start, $end);
If you want to get fancy, use a class factory
$messages = $message_factory->Load($criteria, $offset, $length);
There are many ways to do this. The bottomline is to isolate the data
|