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-19 12:58:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: 'withing' problem [code generation] Date: 19 Nov 2001 15:58:20 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <3be27344$0$227$ed9e5944@reading.news.pipex.net> <3BE42900.7590E899@adaworks.com> <3be65f4c$0$237$ed9e5944@reading.news.pipex.net> <3BF6E4DF.FA47ACDB@adaworks.com> <3BF93F0F.D5E4D0B7@Raytheon.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1006203653 28191 128.183.220.71 (19 Nov 2001 21:00:53 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 19 Nov 2001 21:00:53 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:16699 Date: 2001-11-19T21:00:53+00:00 List-Id: Mark Johnson writes: > Matthew Heaney wrote: > > > "Simon Wright" wrote in message > > news:x7vd72gi0zm.fsf@smaug.pushface.org... > > > If there is a real-world circularity between doctor and patient, and > > > our software engineering tools can't cope with it, it's the tools that > > > have failed and not the real world! > > [snip] > > Simon argued that my solution was inadequate, because there was no simple > > way to a automatically generate my code from the UML diagram. > > Having done code generation from diagrams before - I guess I don't understand > why there is no "simple way to automatically generate code" in this case. I see > at least two "simple solutions" that are not mutually exclusive: > - annotate the drawing to "break the circular dependency here" This is not "automatic", it's "manual". That's the point. > - recognize patterns of circular dependencies and generate code > that automatically generates the new packages (and report such > changes to the user) This may be possible. The problem is that the automatic recogition of patterns may be unstable; small changes in the UML model may make large changes in the new packages. For example, assume your UML model has the Doctor -> Patient circularity. The first time you generate code, it may decide to break the circularity by using a forward declaration for Doctor. Now you tweak the model a bit, and it decides to forward declare Patient. Not a Good Thing! The point here is that extending Ada with "with type" allows some "circularities" to be directly represented, without any user or tool interaction. > We were taking data flow and control flow diagrams to generate the > code for an aircraft simulator. Loops appeared all over the place as > systems interact with each other. However, we had to "pick one" to > run first (on a single CPU). The code generator sorted the blocks > based on how "close" the block was to an external input. Direct > connections were "1", blocks connected to "1's" were "2", and so on. > The precise order the blocks executed was deferred to run time - we > ran all blocks directly connected to inputs that *changed* first, > then all blocks connected to first level outputs, and so on using > the order described above. That tended to minimize latency in our > system - which we considered a *good thing*. This sounds like it could be a stable algorithm, as long as there are not parallel paths from the first block to the nth block. -- -- Stephe