Things like DESCRIBE in Zend_Db_Table and other "overhead style methods
that could easily be cached" throughout ZF should have an option or
check for an available Zend_Cache object and use it if available.
It shouldn't be "required" to use Zend_Cache, but it should be a built
in option.
I sort of see that as one of the main points of doing a framework,
getting all the pieces to "work together", as singular objects no one
part of the ZF really stands out but together they are extremely
powerfull and they should all make as much use of there "siblings" as
possible.
Richard Thomas - Code Monkey
Cyberlot Technologies Group Inc.
507.398.4124 - Voice
Simon R Jones wrote:
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