Re: Feature additions to DB_DataObject_FormBuilder

From: Date: Tue, 02 Dec 2003 09:40:23 +0000
Subject: Re: Feature additions to DB_DataObject_FormBuilder
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-24043@lists.php.net to get a copy of this message
Mocsnik Norbert wrote:
I've checked it. You have everything in 1 .ini file, or am I wrong? I like this. I wonder what the others think about it.
Unfortunately, I got the private mails from the both of you before I read the posts on the lists, so my answers didn't make it here. But here's to this question what I've already answered to Justin: <SNIP> thanks for sending the code, I'll be able to have a look at it tomorrow. I can say one thing right now, though: I think it's not such a good idea to add these options to the databasename.ini file. Two reasons: 1. If you make changes to your database and run the createTables script again, all the settings you've made will be overwritten. You'd need to backup everything first and then reapply what you had changed. 2. That file is loaded and stored in a global variable upon every request that uses a DataObject. If you're dealing with a huge database, that's already a damn big array, and chances are good that you'll only need a very small portion of that data to work with. Storing form field information there as well will only lead to further bloating of that array, eating up memory even when not needed. This is pretty much why I prefer to do settings like these in the code of the dataobject itself - and in fact the possibility to set these options in code are already there. To meet your feature list, the FormBuilder just has to accept more than one field for the display_field and order_field settings. </SNIP>
By the way, my dream is a tool for developers which a) allows you to define a database, set some validation rules, edit field labels and so on b) after making the definitions: create the database, generate and run an .sql script for creating the tables, call createTables.php to create table classes, set the parameters of the generated DataObjects-based classes (fieldLabels, textFields etc.), and somehow tell both FormBuilder & DataObject to use the given validation rules for each table (on both client and server side) that you've specified. If someone has time and experience for being part of such an open source project (based strictly on PEAR), please let me know. Opinions are also welcome.
AFAIR, both Lukas and Alan have expressed their interest in making an MDB version of DataObject one fine day. Using MDB's XML schemas and spicing up the GTK designer with the possibility to add form field and validation information for each database field might do the trick already. CU Markus

« previous php.pear.dev (#24043) next »