Comments on “Cross the Divide, Object Persistence in PHP”

Theo Spears wrote an article that compares three ORM packages on the June issue of PHP Architect. The article is the sample article of the issue and can be downloaded free of charge. We believe many PHP programmers will find the article useful when they try to decide which ORM framework to use. We are delighted that EZPDO was chosen to be reviewed.

EZPDO has been greatly improved in the past couple of months. Thanks to the open-source software model, our user base keeps growing, which has led to the speedy cycle of development, testing and bug fixing. As a result, some of the comments on EZPDO in Theo’s article now no longer hold.

Installation

…… EZPDO also requires the PHP XML and SPL modules which again can be compiled in or installed from packages. It also needs items from PEAR including a few packages that are in Beta state……

EZPDO is now self-contained. If you don’t want to use PEAR::DB (ADODb is used by default), you don’t need to install any PEAR package. Simply download, unzip, and you are good to go.

Configuration

…… EZPDO’s configuration is the least flexible of the thee, and it has the most omplicated configuration file. Configuration must be stored in the project directory, in a file called config.xml……

Use global function epLoadFunction() to load your customized configuration file which could be placed anywhere you want. See this forum post to get more info. There are only 3 options (source_dirs, compiled, default_dsn) that a user has to customize if s/he follows a config.xml template in the examples. We may consider mark the rest of the options “optional” so a new user can simply skip them.

Object query

……EZPDO requires the most complicated implementation; it uses its own query language to allow you to constrain the results, thus you must call the following to get a list of students matching a name: ……

Disagree. EZOQL is a mini query language that resembles the standard SQL SELECT statement. IMHO, it provides great flexibility in object retrieval and can be really helpful for complicated object queries.

Object relationships

……However, with EZPDO, links in both directions are discrete, so you must also modify the teacher to add a reference to the student. This is the expected behaviour from a purely object-orientated point of view but is far less convenient, and violates the Don’t Repeat Yourself principle of avoiding data duplication. …….

This is a valid point. It would be easy to have an option to auto install object relationship on the opposite direction during compiling. [Edit: EZPDO now support bidirectional links between two objects. See description of Inverse of a relationship var. Now available in EZPDO 1.0.3.]

Documentation

……All of its functions are fully documented in the phpdoc scheme, although unfortunately, I could not find a copy of the generated documentation online, so if you want it you may have to generate a copy for yourself. …….

The API document can be found at http://www.ezpdo.net/docs/index.html.

Performance

……a much higher query count for EZPDO, especially when modifying existing data. Clearly, there is room for improvement in the EZPDO engine, especially where existing data is modified, which seemed to require an absurd number of queries………

This was caused by a critical bug in epManager in persisting object relationships and now has been fixed. You need to download a version dated after 2005-06-27 to have this fix. We have also asked Theo to share his code so we have a baseline for further improvement. [Edit: Thanks to Theo for sharing the code used for the article, we are able to make a before-and-after comparison.]

We’d like every user to know that we are constantly working on improving EZPDO performance. The truth is no performance no EZPDO.

Again, we’d like to thank Theo Spears for his review.

2 user comments

  1. EZPDO: An O/R Mapping and Persistence Solution for PHP5 on June 29th, 2005:

    […] is performance. Thanks to Theo Spears for sharing the code for his PHP architect article (our comments), we are able to use it as the baseline for our performance improvement. The following is a table t […]

  2. EZPDO: An O/R Mapping and Persistence Solution for PHP5 on August 1st, 2005:

    […] Thanks to Theo Spears for sharing the code for his PHP architect article (see also our comments), we are able to use it as the baseline for our performance improvement. The following is a table that compares the number of queries per operation before (reported in Theo’s article, php-a) and after (1.0rc4). […]

Post your comments

XHTML: tags you can use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Couldn't find your convert utility. Check that you have ImageMagick installed.