PHP Life

May 30, 2006

What are the reasons to merge PEAR::DB with Metabase classes?

Filed under: PHP — Eugene @ 5:29 pm

PEAR::DB - the very good database abstraction layer now merged with Metabase. The new library received new name PEAR::MDB2. I’ve tried to find out the benefits of this join.

Why I used PEAR::DB?

  • The first reason is that PEAR::DB had unified method names and parameters calling. They fit to Perl’s DBI library. It’s easy for programmers to move from one to another. Very comfortable.
  • The second reason is that PEAR::DB had all required methods to work with different databases: MySQL, PostgreSQL, Oracle. My own experience in moving from MySQL to Oracle is very easy and positive.

What I have now with joining these two libraries?

  • Library name changed from PEAR::DB to PEAR::MDB2. It’s not so bad with a good classes structure. Ok.
  • But ALL method names changed! So, I need to correct all queries in all my classes. There is no backward compatibility at all! It’s Awful! The aim of PEAR::DB was to move from frequent code changing by means of using abstraction layer. And what we have now? Changing code again.

I wonder why PEAR allowed this merge. I can’t see reasons to do this. Can’t find any benefit.

2 Comments »

  1. The API has changed to make the code more flexible, but more importantly to improve portability. For example you can now specify exact datatypes to ensure maximum portability. Some more information can be found here:
    http://oss.backendmedia.com/MDB2/FaQ

    Comment by Lukas — August 3, 2006 @ 9:46 am

  2. I have a lot of classes using PEAR::DB and don’t want to change all of them.
    I think I will write new libraries with MDB2 and leave old ones untouched.

    Comment by Eugene — August 3, 2006 @ 7:46 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.