Re: some general questions about DB_DataObject and DB_DataObject_FormBuilder

From: Date: Wed, 22 Dec 2004 15:47:17 +0000
Subject: Re: some general questions about DB_DataObject and DB_DataObject_FormBuilder
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16415@lists.php.net to get a copy of this message
On Wed, 22 Dec 2004 06:08:19 -0800 (PST), l Burnerheimerton <lburnerheimerton@yahoo.com> wrote: > I am in the middleof a proejct where the SQL coding is getting a little confusing and I am > considering switching to DB_DataObject OR DB_DataObject_FormBuilder and I'd like your > experienced input/advice. > > My project involves around 10 tables in MySQL version 3.xx - INNODB is not an option, thus > casading deletes are not an option. > > Based on a recommendation from Justin, I looked into DB_DataObject_FormBuilder. I also looked > into just using DB_DataObject. > > My experience in PEAR is new but growing. I am becoming fairly familiar with HTML_QuickForm > and customizing it the way I need it to work. I've been using it for a few months off and on. > > Ideally, I'd like to get to a point where: > - I can can build the db in a visual designer like FabForce DBDesigner including foreign keys > - use that to automate building the DB > - run the db through DB_DataObject to build the abstraction classes The one snafu here is that the foreign keys (links) have to be manually specified for DB_DataObject. It has no idea which fields are foreign keys (especially since mysql also has no idea). If you name them intelligently, though, it's pretty easy to write a script which can auto-generate most of the entries. > > Then here's where I have a question: > > - Are forms as customizable using DB_DataObject_FormBuilder compared to just using > HTML_QuickForm? Yes. You can manipulate the form object in the same ways. FormBuilder automates creation of the fields for the form. This is especially useful for foreign keys. You can always change the fields if you want and you can always alter the fields after they're created. You can also do lots of other interesting withs with DB_DataObject (check out Beyond Advanced in the FB wiki for examples). > > - Does it make sense to start over learning the way to customize the forms with > DB_DataObject_FormBuilder since I already feel confortable with HTML_QuickForm? Will it save me > lots of time in the long run? Yes. FormBuilder automates away the small tasks and even supports some of the bigger and hairier tasks. > > - Can DB_DataObject_FormBuilder handle an update form based on a table - what I call a > cross-reference form - basically consisting of all foreign keys? Well....FormBuilder can create a form for *any* DB table, but I don't think that's what you're asking. If you want a form with a bunch of foreign keys, sure it can handle that easy. If you want to link one table to another (many-many relationship) from one of the linked tables, FormBuilder supports that as a crossLink (see the docs). There's also the tripleLink for three-way links. > > Many many thanks for your input and thoughts! Thanks for helping me grow as a developer! > -- Justin Patrin

« previous php.pear.general (#16415) next »