comp.lang.ada
 help / color / mirror / Atom feed
From: pipex!bnr.co.uk!bnrgate!nott!cunews!cunews!knight@uunet.uu.net  (Alan Kni
Subject: Re: OOD, Ada, and Inheritance
Date: 2 Dec 92 14:58:34 GMT	[thread overview]
Message-ID: <knight.723308314@cunews> (raw)

In <1992Nov30.230312.8279@cis.ohio-state.edu> weide@elephant.cis.ohio-state.edu
 (Bruce Weide) writes:

>In article <1992Nov26.012530.7587@fcom.cc.utah.edu>
>val@news.ccutah.edu (Val Kartchner) writes of an example where
>polymorphism is useful.  But unfortunately this example does not
>address the question I was asking, especially the part underlined
>below.  At great risk I therefore repeat the challenge, which was
>prompted originally by some complaints about the quality of the
>examples in J. Rosen's paper that recently appeared in CACM:

>>: Can someone give me a good
>>: example of a case where one wants to have multiple implementations for
>>: SIMILAR but NOT IDENTICAL abstract behaviors, AND for which this
>>: abstract behavior is specified formally and in implementation-neutral
>>: terms (or at least could be in principle)? ...
>>: As part of the example I would, of
>   ----------------------------------
>>: course, expect to see the abstract specification of that part of their
>   ----------------------------------------------------------------------
>>: behavior that these different implementations would all have in
>   ---------------------------------------------------------------
>>: common.
>   -------

OK, here are 3, and although I do not provide the abstract
specification I think it is clear for all of them that such a
specification could exist. Two of them are quite general, while the
third is domain-specific.

1) I/O 
The ability to write to files, pipes, the screen, etc. interchangeably
at run-time is extremely useful, and practically everybody does it
this way.

2) Matrix libraries 

There are a number of different representations of matrices
(sparse,dense,symmetric,asymmetric,definite,upper triangular, real,
double, complex). These differ very significantly in representation
and in the implementation of operations on them, but they all follow
the same abstract behaviour of a matrix. It is clearly nice to be able
to write code that operates on any matrix, and which will use the
appropriate algorithm.

In fact, now that I think about it, numbers themselves are another
example. Reals and doubles have identical abstract behaviour, and
complex numbers add only a few additional functions while leaving the
others unchanged. They clearly have different representations and
operations must take this into account.

3) Finite element types 

I work in finite element analysis, in which we have a number of
different "element types", which can vary with the geometry of the
element or with its properties. Examples would be the 8-node brick,
4-node tetrahedron, 27-node brick, etc.

Without going into too much detail, the routines for solving finite
element problems expect the same abstract behaviour from these
elements (that they give the right answer) without regard to the
internal structure of the elements.
I can elaborate on this if anybody is interested. 


I hope these are the sort of examples you are looking for. 

-- 
 Alan Knight  knight@mrco.carleton.ca  +1 613 788 2600x5783 
 Dept. of Mechanical and Aerospace Engineering              
 Carleton University, Ottawa, Ontario, Canada, K1S 5B6      

             reply	other threads:[~1992-12-02 14:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-12-02 14:58 pipex!bnr.co.uk!bnrgate!nott!cunews!cunews!knight [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-12-04 20:49 OOD, Ada, and Inheritance Bruce Weide
1992-12-04  8:54 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.amer
1992-12-03 21:19 dog.ee.lbl.gov!overload.lbl.gov!agate!usenet.ins.cwru.edu!magnus.acs.ohio
1992-12-02 20:25 dog.ee.lbl.gov!network.ucsd.edu!usc!zaphod.mps.ohio-state.edu!cis.ohio-st
1992-11-20 20:28 klamath.cs.washington.edu!chambers
1992-11-17 20:37 dog.ee.lbl.gov!pasteur!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.ed
1992-11-16 15:09 eru.mt.luth.se!lunic!sunic!mcsun!uknet!comlab.ox.ac.uk!ajs
1992-11-16  8:48 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!Sirius.dfn.d
1992-11-13 22:45 klamath.cs.washington.edu!chambers
1992-11-13 20:37 Bruce Weide
1992-11-11  4:20 sun-barr!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!darwin.sura.net!
1992-11-10 20:58 sun-barr!cs.utexas.edu!natinst.com!news.dell.com!milano!cobweb.mcc.com!br
1992-11-09 18:56 Ralph Johnson
1992-11-09 18:30 eru.mt.luth.se!lunic!sunic!lth.se!newsuser
1992-11-09 16:36 Jorge Luis Diaz-Herrera
1992-11-09 14:53 think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!elephan
1992-11-07 18:49 John Goodsen
1992-11-07  1:25 mole-end!mat
1992-11-06 20:13 John Goodsen
1992-11-06  9:00 agate!doc.ic.ac.uk!uknet!root44!hrc63!mrcu!paj
1992-11-05 19:20 David Emery
1992-11-05 19:09 saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!new
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox