home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.ada:3317 comp.object:4280
- Newsgroups: comp.lang.ada,comp.object
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!elephant.cis.ohio-state.edu!weide
- From: weide@elephant.cis.ohio-state.edu (Bruce Weide)
- Subject: Re: OOD, Ada, and Inheritance
- Message-ID: <1992Nov20.152625.2770@cis.ohio-state.edu>
- Sender: news@cis.ohio-state.edu (NETnews )
- Organization: The Ohio State University Dept. of Computer and Info. Science
- References: <1992Nov11.042043.9740@inmet.camb.inmet.com> <1992Nov13.203723.26049@cis.ohio-state.edu> <1992Nov13.224508.18746@beaver.cs.washington.edu>
- Date: Fri, 20 Nov 1992 15:26:25 GMT
- Lines: 32
-
- In article <1992Nov13.224508.18746@beaver.cs.washington.edu>
- chambers@cs.washington.edu writes (the only response so far to my
- request for "good" examples of the need for dynamic selection among
- multiple implementations of the same abstraction):
- >
- >In my implementation of the Self compiler, I use "run-time selection
- >among different implementation" to good effect in several data
- >structures. One of the simplest is a collection of parse tree classes
- >(in C++), each for a different kind of language construct. Simulating
- >this in Ada would require tagged variant records or something, without
- >behavior attached to each variant. A more complex data structure is a
- >control flow graph, with different classes for each kind of CFG node
- >(e.g. add, branch, merge). All CFG nodes support a common protocol,
- >but with widely-varying implementations. No node knows what kind of
- >node is its successor or predecessor, only its interface.
- >
-
- Craig, I don't really understand this example very well as an
- illustration of the problem at hand. Perhaps by "multiple
- implementations" we mean two different things? I'm thinking of an
- interface as defining a SINGLE abstract behavior -- not just method
- name and parameter profile, but also a specification of that behavior
- in implementation-neutral terms. Any such behavior might have more
- than one possible implementation.
-
- It sounds like you might be thinking of multiple SIMILAR BUT NOT
- IDENTICAL abstract behaviors, and considering them to be different
- "implementations" of the same "protocol." Is this a correct
- assumption?
-
- Cheers,
- -Bruce
-