[MDB2][RFC] drastic refactoring
| From: | Lukas Smith | Date: | Sat, 13 Dec 2003 15:24:35 +0000 |
| Subject: | [MDB2][RFC] drastic refactoring | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-24388@lists.php.net to get a copy of this message | ||
Hi,
Arthur Hundiak approached me a whole back with opinion that MDB2 doesn't go
far enough in terms of restructuring to prevent people from loading
functionality that they do not need. He therefore proposed restructuring
MDB2 very drastically.
Atm most DB abstraction layers for PHP that I know work have the following
inheritance tree:
RDBMS driver extends Common
Now what I could also do is the following:
I could have each driver be separated into multiple inheritance levels which
provide increasing amounts of abstraction. For each level of inheritance I
would have a Common class which implements the proxy pattern. There I would
implement common functionality and common emulation. For the common class to
figure out if to proxy to the driver or not it would check if the method is
available in the driver using method_exists() and if the method exist proxy,
if not it would use some emulation if available or simply return an error
stating that the functionality is not available.
Arthur is currently doing some testing and was quite pleased with the first
results. I havent thought this thing through a lot yet. Anyways if anyone
has some ideas/pointers to this endeavour I would be interested in hearing
them.
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