| Bertrand Mansion 2007-01-19, 8:01 am |
|
Le 19 janv. 07 =E0 09:43, David Sanders a =E9crit :
> m.php wrote:
[color=darkred]
>
> PEAR::DB *is* the abstraction class. Also look at MDB2... some of the
> developers on here can probably explain the beneficial differences =20
> better than
> me.
I would say that PEAR DB is just a wrapper around existing native php =20=
database functions like _connect(), _query(), etc.
Thus, it makes you more productive since it provides a common API for =20=
every kind of databases that is supported. But it is not an =20
abstraction layer in the strict sense because SQL for Oracle is =20
different from MySQL SQL when you need advanced features (limits, =20
procedures, sequences, triggers, transactions...). PDO also belongs =20
to this kind of software but should be faster than DB since it's =20
implemented in C.
MDB2 as far as I know provides a better abstraction.
But complete abstraction is impossible to achieve in my opinion. If =20
you really need portable code, you could also create your own library =20=
which performs specialized tasks and implement one variant for each =20
database you need. It all depends on the complexity of your queries.
--
Bertrand Mansion
Mamasam
Work : http://www.mamasam.com
Blog : http://golgote.freeflux.net
|