| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Databases as objects
Marshall wrote:
> On Dec 22, 1:12 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>
>>Marshall wrote: >> >>>On Dec 22, 9:58 am, Bob Badour <bbad..._at_pei.sympatico.ca> wrote: >> >>>>Presumably, unlike many OO proponents, Parnas thinks not all ideas in OO >>>>are good ideas. >> >>>The funny thing is, I actually like OO, such as it is. Java is a better >>>language than I otherwise would get to use. >> >>>I think it's worthwhile to identify what exactly the good ideas >>>in OO are. >>>I would propose the classic troika: >> >>> inheritance >> >>Eww! Yuck! What's good about inheritance? Reuse is good. Inheritance has >>to be the worst way ever proposed to achieve reuse, though. Generics >>provide greater reuse without introducing inappropriate coupling.
Fair enough.
>>> encapsulation >> >>That depends on what one means by encapsulation. >> >> >>> polymorphism >> >>Again, I suppose that depends one what one means by polymorphism. >>Quite a few things count as polymorphic in my view.
I agree. I want very much a language that allows one to express type generators and generics very easily and well.
>>>Now it turns out that "encapsulation" has two related, widely >>>used meanings: information hiding, and scoping together functions >>>and the data they operate on, which I don't have a good name >>>for besides "encapsulation." >> >>Information hiding is good. Scoping together functions and data does >>exactly the opposite of information hiding by introducing an arbitrary >>design decision the user is forced to contend with. >> >>Take the classic example of a hiring function. Does that scope with the >>employer or with the employee? Either, neither and both are all equally >>arguable in my mind.
Even for a one:many or a zero to one:zero to one relationship, the problem exists. It only gets worse for n-adic operations.
> But again, this is another case where it seems to me a step
> was taken to solve a real problem. The solution isn't the
> right one, but it did solve some problems.
I suggest it was a step that ignored fundamentals in favour of features. I further suggest you will find that focus on fundamentals at the expense of features does a whole lot better.
> The better solution I think is some kind of module system,
> perhaps like SML modules or Haskell typeclasses. In any
> event this sort of modularity question is not one I understand
> at all deeply.
I need to learn more about SML and Haskell. So much to learn, so little time.
>>>And there >>>are many kinds of polymorphism, but only one is emphasized in OO. So >>>the list becomes: >> >>> inheritance >> >>Yuck! >> >> >>> information hiding >> >>Yum! >> >> >>> encapsulation >> >>Ugh! >> >> >>> subtyping polymorphism >> >>Tasty!
Many generic operations depend on properties unrelated to subtyping. Interval generators require a type that is a total order. It doesn't matter whether the type is integer or "third thursday of the month". I am not sure what sort of type system captures the necessary traits.
> Amusingly, I see relational projection as a more general
> mechanism. If we want to construct a supertype instance
> from a subtype, simply project only those parts that one
> wishes to keep.
Projection does not affect types. Even coercing a value to a specific supertype leaves the value's most specific type unaltered.
Is-a colored point a point? Is-a it a
> color? I think "is-a" is the wrong question!
The questions are fine. The answers are "no" and "no".
I can get a
> color and a point out of a colored point with simple
> projection.
Is that project? I am ambivalent, and I have to think about it more.
I can get three different 2D points from
> a 3D point with projection. Etc. You can do this with
> easily with a structural type system, but not with a
> nominal one.
I guess I don't understand the difference between structural types and nominal types that would make a difference for the above.
>>>Inheritance is a mechanism for code reuse, and that's a good thing. >> >>Code reuse is good. Yes. Inheritance? Not so good.
Looking without concluding anything is not particularly useful. I look and I conclude inheritance is not so good.
> Consider the Template pattern. An abstract base class
> with a variety of final methods, parameterized by a
> small number of abstract protected methods. Each
> derived class fills in only the abstract methods.
> I find it is often the case that the majority of the code
> can go in the base class, and I get a fair degree of
> reuse thereby.
Your example presupposes the mechanism. Consider the above with generic operations parameterized by a small number of operations. The question becomes: how to enforce semantics? For example, how do we know that a given operation makes a type a total order?
> Now, I think there are higher-order functional techniques
> that achieve the same thing in a better way, but
> I still consider the template pattern a success.
Given a specific tool, one has to use the mechanisms the tool provides. Given pieces of wood to fasten, a hammer, and a box of screws, the outcome is only natural. That doesn't make a hammer a good way to drive screws.
>>>It is however a somewhat brittle mechanism, and over time the >>>OO consensus has been moving away from inheritance. >> >>That's a good thing. Eventually, they will invent relations.
Nah! Collections will seem trite by then. Don't worry though: someone will coin a bright, shiny new word for them. When agile and extreme finally fall out of favour, the pendulum will probably swing toward some other anthropomorphic trait. Nimble or smart or sane or some such.
>>>Information hiding in the OO sense is a good idea because it permits >>>limiting the scope of updates, which allows some centralization in >>>the manual enforcement of data integrity. >> >>I disagree. Information hiding necessarily hides the locus of effect. >>Limiting the locus of effect is a different design goal that sometimes >>conflicts with information hiding.
Information hiding hides design decisions. It might hide the decision to alter the state of the hard disk. Or it might hide the decision to maintain an index. Or it might hide the audit trail. Those decisions do not limit the locus of effect much.
Similarly, application views hide the design of the base relations from applications. However, that does not reduce the locus of effect. The locus of effect is controlled and maintained at a different level of abstraction from the application views--namely at the level of the base relations.
>>>Once a field is private, >>>it can only be modified within a single class, and so you only have >>>one class's worth of code to look at to see all the ways that >>>field can be modified. However, a distinctly superior mechanism >>>exists in the form of declarative integrity constraints. The reason >>>this is superior is that being declarative rather than procedural, >>>it is easier to get right: you only have to state what must not >>>happen, rather than think of all the ways and all the places that >>>might happen. >> >>I am not sure I follow you here. When declarative, the only difference >>between stating what must happen or what must not happen is simply the >>negation operator. From a security perspective, it is generally better >>to state what is allowed than try to think up all the things one must >>prohibit. Constraints generally must evaluate to true.
I certainly agree with that.
[more agreed parts snipped]
>>Speaking of which, does anybody know of any good online references that >>teach useful statistics? As opposed to the useless crap they teach >>undergraduate engineers?
Please do. It's an area that is becoming increasingly important for our field. Statistics, machine learning and gaming look like the big things in the immediate future. Received on Fri Dec 22 2006 - 22:20:33 CST
![]() |
![]() |