Re: [PROPOSAL] DB_Simple

From: Date: Sat, 01 Nov 2003 01:07:28 +0000
Subject: Re: [PROPOSAL] DB_Simple
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-23168@lists.php.net to get a copy of this message
DB_DataObject is only moderately complex, but does not appear to support automated table creation,
- This has been on the TODO for a while - I Believe people have already hacked the Generator to do this already.
definition of calculated columns, or
- To some limited degree it does.. there are defines at the top which do this.
abstracted data types.
? - The new DB_DataObject_Cast was designed to do this for 'writing' DB_DataObject_Cast::blob() DB_DataObject_Cast::date() DB_DataObject_Cast::sql()
To fill in the spaces between these three, DB_Simple provides: <snip> things that are pretty similar to DB_DataObjects</snip>
- automated validation of insert/update data on a by-column basis This is quite nice.. - Although DB_Dataobjects has a simplistic hooks for validation (I dont tend to use them, much prefering UI validation normally)..
It would be quite logical to seperate this out to DB_DataObject_Validate::validate($dataobject);
- clean-running (no notices under E_ALL) and well-commented code
     compatible with both PHP4 and PHP5
That I have to sort out :) - those PHP5 buggers who broke __call() :)
DB_Simple is _not_: - a data object per se; instead, it acts as an interface to a single
     table for insert/update/delete (although the automated SQL maps may
     select from joined tables as desired)
In theory DB_DataObjects can be used like that.. - and the plan is to move to this concept where some 'dataobject sub classess' arent always needed.
- a replacement for MDB or DB_DataObject, although it walks a
     parallel path.
In general, It has a huge overlap with DataObjects, almost all of the ideas are already in the TODO list for dataobjects. (either the planned MDB version or the current 'classic').. It's a great presentation of the class though (although it's usually better to post links to phps's rather than attaching the file..) I know it's a pain - having completed the current code, but I would seriously suggest thinking if it could be added as a utility class to DataObjects (validation), or add extra functionality to dataobjects (autocalling the generator..., extending the generators type knowlege...) Regards Alan

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