Path: text.usenetserver.com!out04b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!e6g2000prf.googlegroups.com!not-for-mail
From: Tegiri Nenashi <TegiriNenashi@gmail.com>
Newsgroups: comp.object, comp.databases.theory
Subject: Re: Mixing OO and DB
Date: Fri, 8 Feb 2008 13:18:05 -0800 (PST)
Organization: http://groups.google.com
Lines: 80
Message-ID: <670d6288-4229-4267-a5d9-1b8f302675d1@e6g2000prf.googlegroups.com>
References: <89b92dec-b710-4c24-9c8e-731de01fb49a@u10g2000prn.googlegroups.com> 
 <65Zqj.6907$Qj3.4855@trndny07> <1iztr4t1gm74b.107qhvekg5khf$.dlg@40tude.net> 
 <foi0v0$f6g$1@aioe.org> <1oje16zltqtn1.ysvl3v9gk409.dlg@40tude.net>
NNTP-Posting-Host: 148.87.1.171
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1202505485 22371 127.0.0.1 (8 Feb 2008 21:18:05 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 8 Feb 2008 21:18:05 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e6g2000prf.googlegroups.com; posting-host=148.87.1.171; 
 posting-account=PBsn8woAAADaWofLEAjNrE17YVrUmBlm
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) 
 Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 inet-nc02 (NetCache NetApp/6.0.6)
Xref: usenetserver.com comp.object:263509 comp.databases.theory:169532
X-Received-Date: Fri, 08 Feb 2008 16:18:05 EST (text.usenetserver.com)

On Feb 8, 11:32 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:
> The same problem exists with any algebra less flat than numeric fields.
> What is the type of Matrix x Matrix?

Speaking of matrices, what do you possibly achieve by bundling
together the multiply(Matrix,Matrix) function together with the Matrix
data structure (other than loosing the symmetry: consider
matrix1.multiply(matrix2) method call how ugly is that)? Perhaps you
want a convenient listing of all the functions that have Matrix as a
first argument? Such a query shouldn't be a problem in any of
contemporary IDEs which *are* databases storing the source code. Or
you imply that you can define Matrix2x2 and subtype it into
GeneralMatrix? How silly is that (given that it is just simpler to
write general implementation). Or maybe one is advised to subclass the
other way?

If you serious about working with matrices (or any math) in your
application, then you design a mini-language which looks as Maple,
Matlab, or Mathematica.

> The point is though that there is nothing in RA to deserve a special
> treatment. That is actually is not an option, because we just cannot
> provide a tailored solution for each and ever algebra.

You mean you don't want to, or you are not qualified to?

> > For me, the big problem has always been the following :
>
> > SomeType = (x,y,z) (or if you prefer : type SomeType { x, y, z } etc)
>
> > s = SELECT SomeType FROM Somewhere WHERE (x = 123) ;
>
> > In the OO world, the problem is that for each instance of SomeType held
> > in Somewhere, the *implementation* of the property 'x' could be merely
> > an actual data value, or a serious computation process. That is the ADT/OO
> > way.

If x is computed, then why don't you introduce a function that
computes it? In relational world a function call is a join. If this
function is not known at runtime, then what logic is involved in
selecting it? Can't the problem solved by dynamically constructing
this query?

> I see it different. First the above should be decomposed into primitive
> operations over the types involved. There is at least the type of the table
> and one of the cell. If SELECT were doubly dispatching, then one could
> certainly provide different implementations for different combinations of
> types.

What is SELECT? The whole query? The projection part? You OO guys
perfected the art speaking gibberish.

> To me a bigger problem is that RA is "computationally instable" in the
> sense that a minor variations of same constructs may have massive effects
> on resources consumptions, i.e. distributed overhead. OO tries to localize
> effects by decoupling and encapsulation.

You mean optimization? This is true, query optimization in relational
world is far more advanced than the one in the procedural programming
(which includes OO), and therefore it has more challenging problems.

> > It is because of this that I believe that the only paradigm that is capable
> > of providing the true engine for a relational info base that caters for
> > both OO and current RDBMS, is Functional programming (data values and
> > computation entities - functions - are treated the same, techniques such as
> > lazy evaluation, "copy on write" behaviour etc) .

Function is just a relation with functional dependency. It works
pretty much like an index. When a function is called from a query, it
is essentially a join, although there is no ambiguity which order this
join is evaluated. Therefore, in principle, FP is too weak to embrace
relational. It is more likely to happen the other way.

Relational programing has its weaknesses, but they are not what OO
propellerheads think. One missing part in the relational is formal
grammars and languages. The underlying theory of grammars and language
theory is Kleene algebra which is incompatible with RA. Witness how
regular expressions are integrated into SQL, as if there is no common
operation in relational algebra and algebra of strings...
