comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Uncle
Date: 1998/05/25
Date: 1998-05-25T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.3.96.980525151619.3370B-100000@shell5.ba.best.com> (raw)
In-Reply-To: matthew_heaney-ya023680002405981538420001@news.ni.net


On Sun, 24 May 1998, Matthew Heaney wrote:
> In article <Pine.BSF.3.96.980517153518.12746A-100000@shell5.ba.best.com>,
> Brian Rogoff <bpr@shell5.ba.best.com> wrote:
> 
> >You might also want to take a look at John Volan's web page 
> >
> >http://www.bluemarble.net/~jvolan/WithingProblem/FAQ.html
> >
> >on the topic of handling mutual dependencies in Ada. 
> 
> But also read my recent response to Adam's query re mutual dependencies.  I
> disagree with much of John's advice, and think that there are simpler
> solutions.  This particular "problem" with Ada is basically a red herring.

The solution I described is the same as the one from Norman Cohen's
excellent "Ada as a Second Language". The basic idea is to create dummy 
abstract parent types for those types involved in a mutual dependency.

If you've read Ed Seidewitz's OOPSLA '94 paper "Genericity versus
Inheritance Reconsidered" you'll see how some features of inheritance can
be modeled with genericity.

John Volan's approach is an application of this technique to replace the 
inheritance in Norm Cohen's workaround with genericity, and the built-in 
narrowing and widening to instantiation of generic functions, in this case 
Unchecked_Conversions.

In practice, I've found that the dummy parent approach works fine for me, 
but I find the idea of creating dummy types esthetically unappealing.
I don't have experience with a design that required hundreds or thousands 
of mutually referring types, so I don't know how the workaround scales, or 
if its even necessary to scale it up that much. I have used the Composite
pattern in Java, where it was intuitive, and that can't really be said for 
Ada.

-- Brian
 
> Also, read my discription of the Composite pattern in the Mar 97 Listserv
> Patterns Archives of the ACM SIGAda Patterns Working Group:
> 
> <http://www.acm.org/sigada/wg/patterns/>
> 
> (I have trouble navigating there sometimes; let me know if you have trouble
> finding it.)

> 





  reply	other threads:[~1998-05-25  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-17  0:00 Uncle Chip Richards
1998-05-17  0:00 ` Uncle Brian Rogoff
1998-05-24  0:00   ` Uncle Matthew Heaney
1998-05-25  0:00     ` Brian Rogoff [this message]
1998-05-24  0:00 ` Uncle Matthew Heaney
replies disabled

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