Re: Object-relational impedence

From: Yagotta B. Kidding <ybk_at_mymail.com>
Date: Mon, 10 Mar 2008 04:25:15 +0100 (CET)
Message-ID: <Xns9A5CEE5D8F3F7vdghher_at_194.177.96.26>


Marshall <marshall.spight_at_gmail.com> wrote in news:b5ab6022-5cea-45a1- 9e64-fe2b3a04e8de_at_e6g2000prf.googlegroups.com:  

> If the system being discussed is based on structural rather
> than nominal types (which he explicitly stated, although not
> in a very obvious way) then it is sufficient to compare the
> *structure* of two types to determine if one is a subtype of
> the other. In this case, attributes {x, y} are a subset of
> {x, y, z} and so a subtype relationship exists. No, this is
> not how Java or C++ work; OCaml maybe?
>

Yes, you are right about OCAML. I forgot that it indeed uses structural subtyping.

>

>> Even when you establish such relationship,  no projection really takes
>> place,  the information is still there,  it's just hidden,  as can
>> easily be seen by casting back to the original subtype.

>
> Well, this is approximately true, but it's not clear how
> important it is. What does it mean *logically* for a projection
> to "really take place?" What if the language doesn't have
> upcasting?
>
> Note that we can translate Mr. Perryman's code into SQL
> in a fairly straightforward way and preserve all the
> properties he wants from his example. Which is unsurprising
> since SQL is structurally typed.

Superficially, you can perform the translation, but the assignment required to imitate the projection makes any such language not referentially transparent. You may consider the non-transparency a nonissue  of course.

>
>
> Marshall
Received on Mon Mar 10 2008 - 04:25:15 CET

Original text of this message