To answer your first question Nick, we are using Zend_Db_Table on two live e-commerce sites successfully, though only for the admin side of things.
We have used Cake framework in the past and have been rather shocked at the number of SQL requests it makes to understand a table structure. So I'm certainly unhappy about doing that on a front-end site. So Markus's thought of using a mapping file of some kind to describe the data makes a lot of sense. A nice in-between method may be to include a command line scaffold script that auto-creates such DB mapping files to help new users build a site quickly. If such a file didn't exist, it could be generated on the fly at request time. Related to this do we have a "saved" folder concept within ZF where the app can save file data to, or is this just an application thing? Rails uses simple commands to manually associate foreign keys and linking tables together. However, most of the time these work on conventions (i.e. foreign key to a table called "clients" would be "clients_id" or perhaps the singular "client_id") so it is theoretically possible to automate this via a scaffold script. I understand Stefan's point on extending PHP classes, though I don't see that DB mapping requires the complexity of PHP. It may be neater to use a format such as XML or YAML to achieve this. I see the point of auto-complete but unless I've missed something that doesn't work when you use a factory to generate a class object since there is no direct link with the class name and object variable. And I would assume a DB class would use the factory method to instantiate such an object? One step further, if I was optimising such a system to work really quickly I'd cache any mapping information from an XML file to a serialised array for fast access. I don't know if such serialised file caching functionality already exists within ZF. best wishes, Simon
