From: andrew <andrew.carroll@okstate.edu>
Subject: Re: Generic Collection
Date: 11 May 2007 14:55:22 -0700
Date: 2007-05-11T14:55:22-07:00 [thread overview]
Message-ID: <1178920522.908098.104500@e51g2000hsg.googlegroups.com> (raw)
In-Reply-To: <1178918914.8423.47.camel@localhost.localdomain>
On May 11, 4:28 pm, Georg Bauhaus <bauh...@futureapps.de> wrote:
> If you don't care that there is only one type of collection for
> all kinds of objects, then indeed references to DB_thing'class
> objects seem a plausible choice for storing table objects in
> collection. Where
>
> type DB_thing is abstract tagged private;
> type DB_thing_ref is access DB_thing'class;
>
> type attribute is new DB_thing with private;
> type tuple is new DB_thing with private;
> ...
>
> package DB_collections is new Containers.Hashed_Sets
> (Element_Type => DB_thing_ref, ...);
>
> subtype collection is DB_collections.Set;
I'm going to have to look at this more. So far it looks promising.
> Is there really a sufficiently common algorithm for schemas,
> tables, tuples, and attributes?
add, remove, getnext, find, sort, search, etcetera. So yeah, the
basic collection of things type of operations.
> > > > I don't understand why I would have run-time errors. Please expand
> > > > that thought.
>
> > > Just think of the consequences of Java pre-1.5 collections delivering
> > > nothing but Object objects.
> > There was a problem with delivering objects of type Object?
>
> Yes, there was a problem with everything being of type Object.
> For example, retrieving references from collections forces
> type checking at run time and throwing ClassCastException
> when there is a mismatch.
> some_ref = (IKnowWhatType) container.get(some_key);
> That is a reason why Java now has generics.
OOOHHHHH, that...shoot, you had me going there for a minute. I
thought it was something _serious_ that somehow is related to a
problem that Ada would have.
next prev parent reply other threads:[~2007-05-11 21:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-08 19:29 Generic Collection andrew
2007-05-08 21:00 ` Georg Bauhaus
2007-05-08 21:59 ` andrew
2007-05-09 14:51 ` andrew
2007-05-09 16:12 ` Georg Bauhaus
2007-05-09 18:54 ` andrew
2007-05-10 19:31 ` Simon Wright
2007-05-10 22:48 ` andrew
2007-05-11 8:10 ` Georg Bauhaus
2007-05-11 20:41 ` andrew
2007-05-11 21:28 ` Georg Bauhaus
2007-05-11 21:55 ` andrew [this message]
2007-05-12 7:18 ` Simon Wright
2007-05-12 7:52 ` Dmitry A. Kazakov
2007-05-13 11:00 ` Simon Wright
2007-05-13 12:11 ` Dmitry A. Kazakov
2007-05-16 0:27 ` Randy Brukardt
2007-05-16 6:05 ` Simon Wright
2007-05-16 7:17 ` Untagged types don't work right - was: " Grein, Christoph (Fa. ESG)
2007-05-16 13:27 ` Benjamin Place
2007-05-14 17:09 ` andrew
2007-05-14 20:00 ` Simon Wright
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox