Xref: utzoo comp.lang.misc:7274 comp.object:3032 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!bu.edu!snorkelwacker.mit.edu!stanford.edu!agate!sunspot.berkeley.edu!ericco From: ericco@ssl.berkeley.edu (Eric C. Olson) Newsgroups: comp.lang.misc,comp.object Subject: Re: CHALLENGE: heterogeneous collections Message-ID: Date: 4 Apr 91 14:56:19 GMT References: <1991Mar25.220525.11087@leland.Stanford.EDU> <521@eiffel.UUCP> <1991Apr3.211414.25628@bony1.bony.com> Sender: usenet@agate.berkeley.edu (USENET Administrator) Distribution: comp Organization: CEA @ UC Berkeley, Berkeley, CA, USA. Lines: 32 In-Reply-To: richieb@bony1.bony.com's message of 3 Apr 91 21:14:14 GMT In the article Richard Bielak writes: > The generic collection should really be declared as: > > h_collection: COLLECTION [ANY]; > > as any class in Eiffel is an heir of ANY. I read an interesting paper that included a discussion of heterogeneous objects in an object-oriented database. The basic idea was to resolve the class heirarchy as late as possible, but during query semantic checking. That is, given a heterogeneous set of objects to work on, is it legal to apply a particular method on all of the objects? The set of classes (and superclasses) that define the objects are inspected. For each class, the method is resolved (in it or its superclasses). If this method exist in each of the classes, and has the same arity and type, then the query is semantically valid. To me, this seems to be a runtime class definition. For this task, you are defining a runtime superclass with a single method. The generalization would be, given any set of objects, define the runtime superclass which is the intersection of each object's methods (based on arity and type). This is guaranteed to at least be the root class. Hmmm, Eric -- Eric ericco@ssl.berkeley.edu