Re: Two meanings of "data structures"

From: erk <eric.kaun_at_pnc.com>
Date: 16 Nov 2004 06:16:33 -0800
Message-ID: <1100614593.204840.208210_at_c13g2000cwb.googlegroups.com>


I'll give my $0.02: my feeling is that many of the "traditional" data structures were primarily due to the poverty of languages and data management tools and techniques available at the time. Linked list is an implementation of a list, designed for a programming environment philosophically close to C; I've never used one in Java. Fortunately languages have evolved enough in most cases for us to think about Sets and Lists rather than implementations.

In Java I tend to use Map and Set a lot, although using Map is an exercise in frustration because I long for a type-safe Relation type generator, something on the order of the new generics: for example, I could define variables:

Relation<int id, String name, Address address> emps = ...; emps.add({<3, "Fred", new Address("whatever")>}); Address fredsAddr = emps.{<name="Fred">};

and then do some meaningful operations, rather than writing endless loops through impoverished data structures, and designing various classes to act as keys into Maps and then keeping the various maps in sync. All that begs for relations.

This is not to say that the "primitive structures" have no place; I just feel that in most of the programming I do, relations would trump them all.

As far as "drop-in" goes, unless you're talking about dropping in new types (domains) and then using them in relations, it's not really applicable. Relation isn't just a type but a type generator, and it has no sense of encapsulation. However, if I recall Date does address the ideas of tuple and relation type in Intro-DB Systems, but since it weighs 28.37 pounds, I don't have it with me...

  • erk
Received on Tue Nov 16 2004 - 15:16:33 CET

Original text of this message