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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99f33f51845a7793 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-05 01:43:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!newsfeed.icl.net!lnewspeer00.lnd.ops.eu.uu.net!lnewspost00.lnd.ops.eu.uu.net!emea.uu.net!not-for-mail From: "David Crocker" Newsgroups: comp.lang.ada References: <3be27344$0$227$ed9e5944@reading.news.pipex.net> <3BE42900.7590E899@adaworks.com> Subject: Re: 'withing' problem Date: Mon, 5 Nov 2001 09:48:07 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Message-ID: <3be65f4c$0$237$ed9e5944@reading.news.pipex.net> NNTP-Posting-Host: andrew.imsltd.com X-Trace: 1004953420 reading.news.pipex.net 237 194.202.27.87 X-Complaints-To: abuse@uk.uu.net Xref: archiver1.google.com comp.lang.ada:15791 Date: 2001-11-05T09:48:07+00:00 List-Id: OK, so if you think cross-dependency reflects bad design when the implementation language is Ada, can you tell me how you would redesign the Doctor/Patent/Insurer example in http://home.bluemarble.net/~jvolan/WithingProblem/FAQ.html ? Or, take this example from compiler technology. There are various sorts of statement in a programming language, so there is a heirarchy of Statement classes. Similarly, there are various sorts of expression, so there is a heirarchy of Expression classes. Some types of statement can contain expressions, so the Expression class heirarchy needs to be visible within the the declaration of these statements classes. Similarly, some of the Expression classes need to know about statements (e.g. conditional expressions are turned into conditional statements prior to code generation). So we immediately have a cross-dependency. I can then throw a Declaration class heirarchy into the picture and it becomes a 3-way cross-dependency. I should explain that my background is OO design, not Ada. Maybe Ada 95 should not really claim to support object-oriented development? (although it was the first object-BASED language in widespread use). The context here is that we have a OO-based formal methods tool that could make the development of safety-critical software much more productive, but we will either have to compile down to machine code, or find a suitable back-end compiler we can target. Currently we generate C++ and Java, but Ada appears to be the natural choice for the safety-critical market. David Crocker, Escher Technologies Ltd. www.eschertech.com "Richard Riehle" wrote in message news:3BE42900.7590E899@adaworks.com... > Simon Wright wrote: > > > If you are coming from a UML-based modelling environment, > > cross-dependency is entirely natural. It would be quite wrong to > > contort the model to cope with Ada's unfortunate limitations in this > > respect. > > Funny. I don't regard the current context clause (with) as a problem, > when one is designing in Ada. It is most certainly not an "unfortunate > limitation." Rather, the grumbling about it most often reflects a lack > of understanding, or acceptance, of the very strict visibility rules of > the language. As to the potential for circular context clauses, these > need not exist when one correctly designs in Ada. > > When I first learned Ada, what seems now many lifetimes ago, I was > annoyed by the recurring errors I would have due to visibility issues. > The compiler kept bothering me with nasty messages about this. In > time, I came to appreciate that one of Ada's primary strengths is in > is separation scope and visibility. Now I realize that those visibility > rules are essential in reasoning about good design. > > More Ada programmers have problems with visibility rules than with > any other feature of the language. Some will go for years, designing > and coding in Ada, and never come to terms with the visibility rules. > I am reminded of first learning to use a rotating brush floor buffer for > a part-time job in high-school. The brushes rotate over the floor in > their own way. When I struggled to overpower the rotating brushes, > I could not succeed. Once I learned how to balance the brushes > lightly, and guide them across the floor according to their own > behavior, I could control the machine with one finger. Struggling > with the context clause and visibility rules is much the same. Learning > to use those rules, they make the Ada software design > process easy and fun. Try to defeat them and the process is > hard and unpleasant. > > Richard Riehle > >