Re: Mixing OO and DB

From: Marshall <marshall.spight_at_gmail.com>
Date: Sat, 8 Mar 2008 16:15:45 -0800 (PST)
Message-ID: <1f7dba2f-5861-47b4-9cdd-a13f9b1a354c_at_s37g2000prg.googlegroups.com>


On Mar 8, 4:53 am, rp..._at_pcwin518.campus.tue.nl (rpost) wrote:
> David Cressey wrote:

> >Before I move on, I have to give an opinion based on my own data-centric
> >world view. If you don't understand the data, then you don't know what
> >you're talking about. In short, I completely fail to grasp how one can
> >understand a system in terms of "behavior" without understanding the data
> >that the behavior affects. This is something that it's going to take me
> >years of lurking in comp.objects to grasp.
>
> I don't think so. Can we understand the differences between sets,
> multisets, ordered lists, queues and stacks just by
> "understanding the data"?

No, you're not following what David is saying, I don't believe. Queues/stacks etc. are not objects in the domain of discourse. They are data structures; they are part of the toolset. If this was what was at issue, then one could be said to understand any specific SQL database if one understood the relational algebra.

"Understanding the data" means knowing the semantics of the data in the domain of discourse.

> Well, it depends on what you mean
> by "data", but my guess is that you'll agree that the differences
> between them are not so much in their data, in what information they store,
> but on how we can access and update this information; the laws that
> govern their interaction with the rest of the world.

This is all part of the semantics.

> This is what the OO world calls "behaviour".

Is it? I don't believe there is a lot of agreement in the OO world about what exactly "behavior" means. I actually suspect that many of them like it that way. At least some of the time, "behavior" means nothing more than the set of methods of a class.

> Behaviour is what an object looks like
> from the outside. Data structure is what it looks like from the inside,
> its implementation.

"Data" is not "data structure" or implementation.

> Here, I have some data for you:
>
> 1,129,960,000 March 8, 2008
> 303,569,100 March 5, 2008
> 231,627,000
> 186,315,468 March 1, 2008
> 162,652,500 February 29, 2008
> 158,665,000
> 148,093,000
> 141,933,955 March 1, 2008
> 127,790,000 December 1, 2007
> 106,535,000
>
> Completely useless, unless you understand which interactions
> with the real world these figures correspond to.

It's useless because you haven't specified any semantics. Once you tell me what the data *means* it won't be useless any more.

> So I think your suggestion that understanding is somehow tied to data,
> not to behaviour, is flat-out wrong. We do need to understand the
> operations on our data before we can understand the data.

That cannot be the case. If it were so, a read-only SQL database would be useless, because one is unable to transform it at all. It has no behavior. But often one can get extraordinary use out of a read-only SQL database, provided one knows the semantics, understands the data.

Marshall Received on Sun Mar 09 2008 - 01:15:45 CET

Original text of this message