in reply to object-relational Perl programming: best practice or compromise?

To expand on the comments I made to you on the mailing list:

OO databases have been around for over a decade but the technology is still rather moribund. As for our company, such a database would be a perfect fit for our data needs but there's no way in heck we would use one. Object Query Language was never standardized (well, it was, but vendors ignored it) and frankly, we have been in the position where we have to switch backends so having a standard query language is critical.

As for Class::DBI and DBIx::RecordSet, I don't think there's much of a choice there for me. For a pre-existing application, many people already have a well-defined object system in place and a natural migration to Class::DBI or something similar is a straightforward refactor as opposed to a redesign. I know which I would prefer.

DBIx::RecordSet, by contrast, uses a procedural interface, encourages the use of typeglobs and has no test suite (its "test.pl" does not count.) There's no way I'm going to tell my boss that we should base our fortunes on that. That's not to say it isn't a good piece of software. Maybe DBIx::RecordSet would be a nice tool to experiment with on a new, small app that's not mission critical, but that's all I would use it on. Give me a solid test suite that plays well with Test::Harness and I'll reconsider.

Class::DBI, by contrast, has a huge test suite, it's dead simple to use and for large applications slinging objects everywhere, it can frequently be used internally to make the code much easier to manage without the programmers working in the upper layers even noticing a difference. Is it perfect? Heck no, but for those applications where it fits, it fits quite nicely.

If you just hate Class::DBI, check out Tangram, Alzabo or some other well-tested software.

Cheers,
Ovid

New address of my CGI Course.

  • Comment on Re: object-relational Perl programming: best practice or compromise?

Replies are listed 'Best First'.
Re^2: object-relational Perl programming: best practice or compromise?
by metaperl (Curate) on Oct 26, 2004 at 17:43 UTC
    DBIx::RecordSet, by contrast, uses a procedural interface, encourages the use of typeglobs and has no test suite (its "test.pl" does not count.)
    I think you should look at the size and comprehensiveness of test.pl. It is not missing anything that the module documents as functionality --- I know, I maintained the module for one cycle. Further, you do not have to use typeglobs with Recordset... see the docs for detail. And finally, a procedural interface means that all of your object modelling and conceptualization is in one place and one place only: the database.

      Ignoring the other issues and focusing on the important one: test.pl does not count as "tests." I've read through it and it looks reasonably comprehensive (tough to say, though), but it doesn't play well with Test::Harness. That's why it has all of the test failures being reported. Why the author decided to ignore the standard way of reporting tests, I can't say, but this does not inspire any confidence in me. If it starts to use Test::More, Test::Class, or some other testing tool that reports its output to Test::Harness, I'll take another look. Right now, because this type of software would be foundational, I can't recommend it. That would be irresponsible of me. (By this token, I even admit that a lot of my older code falls into the "can't recommend" category.)

      Cheers,
      Ovid

      New address of my CGI Course.