University of Bielefeld Faculty of Technology Joern Clausen  

Homepage
Education
Development
Documents
Links
Contact
Weblog

Persistent Objects with O2DBI

O2DBI tries to make a connection between two worlds: Object Oriented Programming and Relational Databases.

As an application programmer, you want to access your data as objects. At the same time, you want to store the data in a reasonable fashion at an appropriate place, which is usually a database. Although you could use an object oriented database, in many cases you would choose a relational database (RDBMS):

  • Relational databases are better understood by more users, as they are more common.
  • The number of products to choose from is much larger.
  • A number of free products (e.g. PostgreSQL, MySQL or Mini SQL) are available.

To help writing Perl applications that store data in a relational database, yet allow access to the data in an object oriented way, I have developed O2DBI. This tool takes a simple description of your objects and transforms it into a database schema and a bunch of Perl modules for accessing the data. Although O2DBI has (still) some severe limitations, it is quite usable for small projects and fast designing of protoypes.

You can download the Perl module O2DBI.pm (sorry, no MakeMaker package) and a paper describing it's usage and some of the principles and design decisions.


Jörn Clausen
created: 2001-07-19 / last modified: 2001-07-19