Forum Moderators: coopster

Message Too Old, No Replies

PHP, database abstraction, OO-quer, active record

best practices, success stories?

         

pixeltierra

7:13 am on Jan 9, 2008 (gmt 0)

10+ Year Member



I've been meaning to change from my home-made Database abstraction classes (couple of years ago) to a more modern, externally-maintained solution.

I have looked into the PEAR-based [pear.php.net] tools like MDB [pear.php.net] and also looked at the pure php 5 PDO [us2.php.net] functionality, and a bunch of others.

What have others chosen? I'm primarily interested in having a layer that abstracts what type of DB I'm talking to, and a layer on top of that (like active record) that turns interacting with a DB into interacting with an object.

A friend of mine is always praising Rails, and how easy the DB interaction is out of the box. Most of the DBO for PHP stuff I run into requires that I pre-configure each DB table in a class.

What have others found to be the easiest implementation of DB abstraction and 'objectification', that is still flexible?

henry0

12:52 pm on Jan 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since a while I use a system that makes lot of sense
very flexible, reliable, easy to customize.
I do not remember how I found it
so I plugged some terms in G and found an article about it
try to G for
"PHP 5 OOP: Interfaces Abstract Classes and the Adapter Pattern"
if you do not find it, mail me.

phparion

3:32 pm on Jan 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I will encourage you to pm me the download link of this system you are using so that i can have a look at it.

I have written my own database interface classes and for all projects now, i just extend classes with new classes and start working easily. It not only gives me fast method of development but also the ease of dealing with databases with the same technqiues.

Did you try PEAR package for PHP? also php classes [phpclasses.org] is worth of book marking.

henry0

10:59 pm on Jan 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I get php classes
but the for a fee one; hate advertising :)
It has helped me a great deal in making a couple of very useful AJAX scripts
Took me forever! I never paid attention to JS
Guess I was wrong - Mea culpa-
<edit>typo</edit>

coopster

4:24 pm on Jan 10, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I use my own custom class database abstraction layer. It is extremely fast and efficient and I've built in debugging and query recording routines. I like the flexibility of my own class. But the number one reason I use my own is ... I know the code!