Re: acceptable way to program

From: Chris Uppal <chris.uppal_at_metagnostic.REMOVE-THIS.org>
Date: Sun, 2 Jan 2005 12:20:04 -0000
Message-ID: <udCdnZx1_v1ke0rcRVn-qg_at_nildram.net>


fishfry wrote:

> > Yes, I would agree with the relational database. ORDB are mainly hype
> > and usually promoted by coders that have never had to write a report or
> > mine data effectively.
> >
>
> Is this really true? I'm an experienced database programmer learning the
> Java/OO way of doing things and I'm puzzled that people use Hibernate
> and similar tools to define objects, with the database serving as just a
> passive serialization mechanism with no thought to database theory.

It may help to consider the difference between:

  1. a program (or group of closely related programs) that happens to require (ACID) persistence.
  2. a program that is required to manipulate independently-existing data in a more-or-less public repository (database).

The difference is in whether the program or the data is primary.

The two are not the same, although the same technology /can/ be used to approach both kinds of requirement.

In my opinion, O-R technologies are mostly about (a) -- that is to say they provide a poor man's object database. As such the issues you raise are largely irrelevant. (Of course, that's not to say that a /real/ object database should only be viewed as a mere persistency mechanism, but the only one of those I know of is GemStone.)

Many real life uses of databases, though, don't fall into the (a) category. The data itself is /at least/ as important as the program(s) that manipulate it. Relational databases (and relational DB theory) are mostly about that scenario.

I, personally, think there's a fairly severe conceptual mismatch between table-centric relational databases and object-centric programming. That manifests in a number of ways, one of them is that it's awkward to do clean OO programming against externally defined data (scenario b). As a result, programmers looking for a "quick fix" will naturally tend to try to use OR technology to paper over the gap. Whether that works well must depend on a number of factors, and I can see why Tom might characterise it as "mostly hype" (I don't have enough experience of OR to agree or disagree), but I think that what's really happening is that a tool designed for one purpose ("poor man's object database") is being used for another purpose. When you get right down to it, that is little more than a hack. Like all hacks, it /might/ work well, even very well, for some purpose, but it's not the same thing as using the right tool for the job.

  • chris
Received on Sun Jan 02 2005 - 13:20:04 CET

Original text of this message