Re: OOP - a question about database access

From: Costin Cozianu (c_cozianu_at_hotmail.com)
Date: 11/07/03


Date: Thu, 06 Nov 2003 23:19:54 -0800

Uncle Bob (Robert C. Martin) wrote:
> Costin Cozianu <c_cozianu@hotmail.com> might (or might not) have
> written this on (or about) Thu, 06 Nov 2003 18:14:30 -0800, :
>
>
>>I can prove that to you, but I think it would require too much effort,
>
>
> In other words you are unwilling to hold yourself to the standard that
> you require of everyone else.
>

Those are your words, they are not mine, and you are wrong.

When I caught your essential lack of knowledge with regard to static
typing, I didn't hold you to that standard, I held myself to the
standard (more than it was warranted for the situation) to show you
precisely that you were wrong.

It should have been you that *should not have touched the subject*
knowing how much lack of necessary reading and programming you have in
that area. And please don't tell us that your decades of programming in
C,C++ and Java makes you have some kind of expertise on static typing
and OO.

A fair and honest statement from you, would have been something like "I
now like dynamic typing very much" and about the static typing I can't
say much except that I don't like C++ and Java as before.

> Your statement was that I don't know how to use databases properly.
> You stated this as a fact.

Your advice was basically the decade old cliche:

     You can design your app and object model as if the database didn't
existed, and at the end, after your app is working with objects just in
memory you find a way to map them to the database (also regardless if
database is totally new, or it integrates with existing data and other
apps).

I said that I'm willing to be contradicted. The fact is that your advice
is bad advice, it is an anti-pattern. I can claim that as an
anti-pattern, better than you can claim it as good advice.

And before you jump in again and whine about my lack of proof, let me
give you another *matter of fact*:

The field of complex numbers is algebraically complete.

Do you want me to prove that as well ? I can assure you that I can ,
while you most likely can not, however it would require too much effort
on my part, effort that is not warranted by the reward. Such is the
effort required to convince you of the fact that leaving out the
database from the design of your object model. Now you disingenously
want to cast that effort entirely on me.

So where does that leave us, on databases ? Well, for the purpose of
"posing" to others it's a difference of opinions.

> When others state things as fact that you
> don't agree with, you advise them to "stay within their area of
> expertise".

Now, Uncle Bob, your anger blinded you to the point of being
disingenuous, which is a sad state of affairs.

You know by now that it was not just "I disagreed with you", but
actually your claim ("You cannot achieve polymorphism without
inheritance. [in a statically typed language]") is

a. trivially false
b. known to be false since at least 1990
c. it is a matter that is elementary for type theory and students now
learn that in Programming Languages 101.

This leads to the only logical conclusion that you don't have any real
expertise in the area of statically typed languages.

Actually you do have a clue as to that is polymorphism and what is
inheritance and what is static typing you wouldn't put all those words
together. You don't have a clue other than your experience with Java and
C++, which really is very little. Other than proving to you the falsity
of your statement with code in OCAML (I could have used Haskell as well,
and these two are really major languages), I can direct you to google
for the following paper:

William Cook "Subtyping Is Not Inheritance" (1990)
William Cook "A Denotational Semantics" (1989)

I put the years so that you know that the confusion you make has been
clarified for quite a while. That will explain to you clearly the
difference between inheritance subtyping and polymorphism. And it would
be nice if you went back to the basics and have a look at a "programming
101" kind of book, that is available online, thanks to the generous
authors (http://www.info.ucl.ac.be/people/PVR/book.html) :

Peter Van Roy and Serif Haridi:
    Concepts, Techniques, and Models of Computer Programming

If you study that book, you will find out that a student who took the
introductory course in programming "concepts, techniques, and models"
would not be excused to claim "you cannot achieve polymorphism without
inheritance". Actually when another newbies asks here for advice and
books, it would be kind of you to recommend this very book instead of
(or before) your fancy shmancy books, as it is much more profitable to
them, and even you have a lot of basics to learn from it.

So after I gave you all these suplementary explanations ( just because
your pretended you didn't know how things stand), please make up your
mind, either:

a) I was just that Costin had a "difference of opinion" on static typing
and polymorphism
b) Uncle Bob was factually wrong on a very basic language design issue

> I'd like you to either prove the fact you asserted, or
> advise yourself to stay within your area of expertise.
>

You may like, but given your disineguity in dealing with the previous
subject I don't think you earned it for me to spend that much effort.

> I don't have to supply you with any more data. You have asserted a
> fact. I require you to apply your own standards to yourself.

Like the standards you never applied to yourself ?

Sure you have to supply more data. Here is why: you were proven to hide
behind the bushes previously.

Now you want to transform a "Uncle Bob claimed something/Costin has
claimed something else" situation into one where I'd have to put quite a
lot of voluntary effort that will not benefit me at all. This is grossly
unfair, especially just because you want to hide behind the bushes again.

The very least of data that I demanded of you was to tell me the latest
book on database theory that you actually read.

And this is because the proof exists, I know what I know for sure. I
have enough expertise both in database theory and practice (including
DBMS internals, DB access frameworks, client server protocol) and in OO
(both practice and theory -- the later you clearly do not have). I can
prove very easily that you do not have an appropriate level of expertise
-- the level required in order for you to have the boldness to
generalize from your opinions and experience to the point where you
confidently give advice to others.

> Either
> prove the fact, or send yourself one of those slyly derisive posts you
> so often send to others.
>

Now, what I don't do to others, is I don't pose as an expert, I don't
give bad advice, and I stay within the areas I happen to actually know
more than just scratching the surface.

Costin



Relevant Pages