2008年8月5日星期二

Re: [fw-db] Table Inheritance?

Greg Freeman wrote:
>
> Just a few more questions around this; what about fetching data. Is it
> possible to fetch the corresponding rows from child and parent table and
> then merge and return them as if they were one complete row?
>

Yes -- but then the row is read-only, and you can't then call save() on the
row.

See this thread:
http://www.nabble.com/Delete%2C-update-and-insert-in-joined-table-(model)-td18790541.html#a18792639


Greg Freeman wrote:
>
> Would you also place this custom UserModel class along side the other
> models in your application? (application/models) or in a custom library?
>
> I would rather have this kind of logic in php and not in the database, I
> like to have all my application logic in php so it is easier to maintain.
> This is more important to me than high performance.
>

Yes, I'd put both the UserModel class and the table classes under
application/models.

It's often easier to develop the table-associations logic in an application
programming language like PHP rather than triggers. It's too easy to get
locked into one brand of database if you use triggers and stored procedures,
since their syntax varies by brand so much. Also, the tools available for
SQL development aren't as sophisticated as those for application languages
like PHP, so activities like debugging and version control are easier if you
use PHP.

Regards,
Bill Karwin
--
View this message in context: http://www.nabble.com/Table-Inheritance--tp17716295p18843018.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: