Re: [PHP4BETA] Re: Couldn't find your reference
| From: | Chad | Date: | Thu, 18 Nov 1999 14:42:47 +0000 |
| Subject: | Re: [PHP4BETA] Re: Couldn't find your reference | ||
| References: | 1 | Groups: | php.dev php.version4 |
| Request: | Send a blank email to php-dev+get-12728@lists.php.net to get a copy of this message | ||
> Bingo. This (database interface dependency) IMO is the biggest problem
> that needs to be solved with PHP. It supports a wide variety of
> databases with APIs that are very similar in function, but they're all
> different. We do a lot of work with MySQL and Oracle around here, and
> with Perl/DBI you can often go from one to the other with no changes at
> all (except the connection string). It couldn't possibly be easier.
Just to comment, I felt this comment was a bit much. Database
Abstraction is a good options to have, but I think the biggest problem
with DBI is that it's ALL you have. Sure you can call functions, but
then your code is no longer portable. In a case like that I think it's
better to not abstract the API, but to abstract the database
interactivity itself by having your app call generic routines like
getData and then have a plug in script/module that can get the data
however it wishes from the database. This is the only way to truly allow
your app to work cross database. However, in many cases a simple
abstraction of the API is enough, but I'm not convinced this is
something that would be that advantageous to put in php as opposed to
just doing an abstraction in php (such as phplib and phpDB do).
Performance might be a bit better with it native, but with php4, is it
really going to matter? I think it should be more like what perl does,
where it's not a part of the core language, but rather another module
that can be downloaded. But perl has a bit more advanced idea of
packages, so that might be something that needs to be addressed.