Wow some great replies and I'm really glad I asked the question now.

This one from Abu Hurayrah* was the kind of insight I was after when I said "particularly from those who have a database admin leaning and have opinions about its efficiency"...

Additionally, ORM will enforce consistent queries, enable (but not force) higher security standards due to consistency of query structure and actually lets the programmers work on writing their code efficiently, and the database blokes (such as myself) can work behind the scenes transparently optimizing the internals of how the object-oriented abstractions work

I also liked the "added-value" in Rob Allen's idea...

One option would be to cache the describe (forever!) when in production mode though and not cache at all in dev mode.

Personally, I've used a form of DESCRIBE caching but all I did was to serialize the info and write it to a "database_structure" file, rewriting it when any changes are made to the database in this manner:

/*
* Uncomment to rewrite database structure file
*

foreach( $dataConnection->MetaTables() as $key => $value )
{
        $database[$value] = $dataConnection->MetaColumns( $value );
}
$File->WriteFile( $database, TRUE );
*/

$dataConnection->Tables = $File->ReadFile( TRUE );


I notice that Rob you have a "Zend_Db_Schema_Manager" in proposal and wonder whether it, or something like it, could be used by Zend_Db_Table in some way?

Anyway, thanks to you all I think I "geddit" a bit more and will be looking at the progression of Zend_Db_Table a bit less suspiciously now.

Nick

* OT: I was going to shorten your name but presuming it to be Arabic and knowing the shortening of Arabic names is often done wrong I refrained.

Very OT: Interestingly, in an almost shamefully geeky way, Arabic naming almost has a namespace type convention so "Saleh bin Tariq bin Khalid Al-Fulani" using dot notation could well be written as Al- Fulani.Khaled.Tariq.Saleh. Anyway, meant an interesting diversion to Wikipedia ( http://en.wikipedia.org/wiki/Arab_name ).

Reply via email to