Re: dataobject

From: Date: Mon, 11 Oct 2004 12:58:48 +0000
Subject: Re: dataobject
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-33769@lists.php.net to get a copy of this message
Just a quick / slightly anebreated response.. (I havent had time to look at the code)
just wanted to let you know that I ported DataObject to MDB2 in a few hours while sitting in a farm house in switzerland :-)
sounds nice :)
The current code can be found here: www.backendmedia.com/MDB2/MDB2_DataObject.zip Dunno if its possible to fit this into your plans regarding a DO ext. Anyways here are a few notes I made along the way: - numrows is expensive in combination with unbuffered queries
interesting.. - I wonder if that affects libgda as well.
- use MDB2 quote method for all datatypes (only use type constants internally - they seem very useful for complex types like "email" and should probably be integrated into MDB2 itself for internal use)
I'm not sure about the value of MDB datatypes - MDB1's types where far too over abstracted, I havent looked at MDB2's - I guess they have improved a bit.. (the problems where approaching the abstractions from a generics->db angle as apposed to a db->generics.
- use MDB2::singleton and db_index to manage MDB2 objects
I removed all the singleton methods early on in DB_DataObject (and replaced with private globals), as they appeared to be one of the performance killers
- use MDB2 internal debugging capabilities - can we model raiseError after MDB2's raiseError()
Not seen it - what does it do differently?
- can we get rid of extends PEAR in MDB2 (loosing expect() error) by a custom raiseError()
? - can you expand on this?
- insert/update/delete should return affected rows
This would be a major BC break.. - I'd be tempted to introduce exceptions/or PEAR error returns if BC was going to be busted at the same time..
- use MDB2 manager (reverse) to read database infos
?? - the idea is good.. - see comment earlier about over abstraction...
- integrate xml schema format (possibly use a custom parser) - MDB2 emulates database for oracle with users - sequenceKey() seems overly complex
yes - it's BC ontop of BC ontop of BC.... - I should have gone down the path of - if it's definatly not the primary key / autoincrement / nextval, give up! There are issues here - mainly to do with taking advantage of native incrementing on various backends (eg. actually using nextval() and auto_increment.)
- we need file_exists($foo, $use_include_path) !!!
possibly...
- how are indexes handled? how are multi column primary keys?
see sequenceKey comment.
- instead of the generator allow custom serializer and custom fields in the manager - use templates with generator?
maybe..
- MDB2 has float type support
?????
- MDB2 quote converts php null to sql NULL
this isnt a major issue... :) - but php null is totally unreliable... - so I never trusted it..
- MDB2 has all the methods needed to create tables
I've not looked at MDB2's version, but MDB1 was pretty messy AFAIR- it created char(1), even if the DB supported booleans.
- MDB2 has replace() support
This is very kludgy with DataObjects (it's a hell of alot cleaner with dbdo)
- add support to accept existing MDB2 objects
At this point in time, the big question goes, should a new version of DB_DataObjects, that is there when dbdo is not available: a) support PHP5 only? b) use PDO? c) use some of the object overloading ideas in dbdo? Regards Alan
regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07


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