Re: Mixing OO and DB

From: David Cressey <cressey73_at_verizon.net>
Date: Fri, 08 Feb 2008 13:48:50 GMT
Message-ID: <65Zqj.6907$Qj3.4855_at_trndny07>


"Victor Porton" <porton_at_narod.ru> wrote in message news:89b92dec-b710-4c24-9c8e-731de01fb49a_at_u10g2000prn.googlegroups.com...
> I know both object oriented programming and DB (SQL). But it seems
> that these are incompatible. Or may somebody advice how to meddle them
> together?
>
> Being strong in both OOP and DB development, I am yet weak in writing
> object oriented programs which use DB.
>
> Maybe somebody may suggest me some article about mixing together DB
> and OOP?

First off, I think it's reall the mixing of OO and RDM that's of interest, rather than the mixing of OO and DB.

Better minds than mine have attempted to deal with the impedance mismatch between OO and RDM. In general, they have been disappointed by their own results.

I suspect that most of them have gone about it in the wrong way. Most of them have tried to project an object world onto a system of relations. What they end up with is presistent data that captures the state of each object, and its membership in a class. The behavior of objects that belong to any class is generally defined outside of any coherent data model (even if it's stored in a blob in a database).

I think it might be interesting to explore the whole concept backwards: start with the idea that a table is just a specific class of object, and a persistent table is just a specific class of persistent object. Then come up with two things: how to store persistent objects and retrieve them when necessary without regard for any data model; and how to get tables and application objects to collaborate on common objectives.

This doesn't sound easy to me, at all. But it could be promising, provided there is real value in OO. I don't know OO well enough to have a considered opinion on that score. Received on Fri Feb 08 2008 - 14:48:50 CET

Original text of this message