About the xPDO Project

xPDO is our name for open eXtensions to PDO. It's a light-weight ORB (object-relational bridge) library built directly on PDO. It implements the very simple, but effective Active Record pattern for data access.

But xPDO is a little more than a simple pattern implementation. It's a way to abstract business objects from the actual SQL queries and prepared statements used to access a relational database structure representing them, and a way to easily describe and provide optimized implementations of an object model for multiple target database platforms.

xPDO is not a query abstraction tool, so the generated classes and maps are targeted at a specific platform to get you started. You just add your own methods and SQL to the generated classes to implement your application-specific business logic. xPDO was inspired by the need to provide an object-oriented API for a web application that is easy to develop with and maintain, and could be optimized as much as possible for the database platform it was being deployed on. And it needed to provide this with as small a code footprint as possible. For this reason, it specifically avoids the approaches of parsing and/or generating platform agnostic SQL that often doesn't take advantage of important performance-related features on each platform, or of relying on proprietary query expression languages that often generate unoptimized SQL in favor of supporting more platforms. And by using PDO directly for database access, avoiding another abstraction for the DBAL further sidesteps overhead seen in most other O/R mapping tools.

What is an ORB?

I refer to xPDO as an Object Relational Bridge, or ORB for short, because I like it better than the more popular ORM acronym, which stands for Object/Relational Mapping, and the more concise OPF, or Object Persistence Framework, just doesn't sound as good as ORB does. It has been adopted previously by several other projects including the Apache OJB project for J2EE, and now Modeling for Python (inspired by NeXT Software Inc.'s Enterprise Object Framework).

Features of xPDO

  • Object-Relational Bridge (ORB) for mapping persistent objects to platform-optimized relational database structures
  • Utilizes PDO, the database access layer adopted as the standard for PHP 5.1+, which provides lightning fast interaction with various relational database platforms.
  • 2.x provides E_DEPRECATED compliance with PHP 5.3.x as well as E_STRICT compliance for PHP 5.1.1+
  • The code is ultra-light weight, and loads only what it needs on demand, so it adds virtually no overhead to your scripts. This was done by using generic methods and accessors and keeping all core code native PHP (i.e. no XML configuration parsing or other serialization involved).
  • Promotes platform optimization in conjunction with object abstraction.
  • Supports any database platform accessible with a PDO driver implementation.
  • Fast generation of your classes and their metadata maps from an xPDO model definition.
    (NOTE: a model definition is simply an XML schema describing an object-relational mapping)
  • Fast generation of xPDO model definitions from an existing database.

Coming Soon in xPDO 3.0

  • Install via Composer and Packagist.
  • Full support for PHP namespaces and backwards-compatibility with non-namespaced legacy models.
  • Easy-to-use CLI script for reverse and forward engineering of xPDO schemas and models.