From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d7888dd6424b687 X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Uncle Date: 1998/05/25 Message-ID: #1/1 X-Deja-AN: 356469478 References: <6jlk5s$mob@tomquartz.niestu.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: 896137556 4786 bpr 206.184.139.132 Newsgroups: comp.lang.ada Date: 1998-05-25T00:00:00+00:00 List-Id: On Sun, 24 May 1998, Matthew Heaney wrote: > In article , > Brian Rogoff 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: > > > > (I have trouble navigating there sometimes; let me know if you have trouble > finding it.) >