Re: OO and relation "impedance mismatch"
Date: Mon, 4 Oct 2004 08:31:09 -0400
Message-ID: <UqKdnfBe9-U-3_zcRVn-hw_at_comcast.com>
"Fredrik Bertilsson" <fredrik_bertilsson_at_passagen.se> wrote in message
news:31f7e57d.0410020300.16f447fe_at_posting.google.com...
> OO people often claims that there are an impedance mismatch between
> the OO model and the relational model, that makes it very hard use a
> relational database when you are using an OO programming language. I
> am wondering if "relational" people at this forum feel the same thing,
> that it is hard to use a OO language when you are using a relational
> database?
I kind of like the following article for a coherent description of object relational mapping:
http://www.chimu.com/publications/objectRelational/
I'm wondering what your opinion is. I've already gotten reactions from some
of the regulars here a few months ago.
My own reaction is that it's good, but it's upside down.
Instead of "integrating objects into the relational model" I think it would ultimately be more productive to "integrate relations into the object model". That is, we need a coherent description of a "Relation" as a ceratin class of objects. In earlier discussions, some OOP people showed an extension of C++ that defined objects called "tuples". I don't know how to evaluate this work, so 'll defer to the OOP experts on this. But let's say it passes the test. You can always define a "set" as a class of objects, can't you? And now, cascading those two, it seems to me that you can define a relation as a class of object, a "set of tuples", and come up with operators and methods that do useful work on relations.
The only features left out are the classic database features: persistence, sharing, concurrency, etc.
Here's what I would do: I would try to solve the OODBMS problem without reference to the relational model as such. I would try to abstract out of classical DBMS theory the essential features we want in any DBMS, regardless of whether it's based on the relational model or not. (e. g.: what features do we want in both VAX Rdb and VAX DBMS) The example is from history, but is by no means definitive. The goal is to come up with some decent, solid system, that makes objects persistent and shareable, in an "object base". You are now ready for integration.
In the former paragraph, I outlined a project that would define a "Relation" as a certain kind of object, and would make interacting with it as easy and natural in an object world as interacting with any other kind of object. In the latter paragraph, I outlined a project that would generate a "Real" OODBMS, but not necessarily relational.
Now it's time to integrate: A persistent and shareable relation is just a certain kind of persistent and shareable object that is stored in an OODBMS that makes persistent and shareable objects manageable. It sounds easier than it is, but it might be doable. Received on Mon Oct 04 2004 - 14:31:09 CEST