Re: Mixing OO and DB

From: David Cressey <cressey73_at_verizon.net>
Date: Mon, 11 Feb 2008 22:21:12 GMT
Message-ID: <sT3sj.2953$J93.474_at_trndny08>


"Robert Martin" <unclebob_at_objectmentor.com> wrote in message news:2008021110111250073-unclebob_at_objectmentorcom...
> On 2008-02-07 14:35:26 -0600, Victor Porton <porton_at_narod.ru> said:
>
> > 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?
>
> The concepts are orthogonal. Objects are not tables. Tables are not
> objects. The many efforts to try to force tables and objects together
> always cause trouble. Things work better when you recognize the
> benefits of tables, and the benefits of objects, and use each where
> they belong rather than try to force one to use the other.
>
> Tables expose data and have no behavior. Objects hide data and expose
> behavior.

I have a different understanding.

Objects do not always hide data. Specifically, they pass messages to each other in the form of data. Going further, objects do not "see" the behavior of other objects. What they see is the data, written into messages, that is the result of behavior. Seeing the result of behavior is not the same thing as seeing the behavior itself.

One could do a data centric analysis of an object world, by analyzing the data passed among the objects in that world. Such an analysis would be much more like the kind of analysis one makes of a database. Or, perhaps more likely, analysis of a set of information requirements that is to be filled by a database not yet designed. Received on Mon Feb 11 2008 - 23:21:12 CET

Original text of this message