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-09 12:25:29 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: 'withing' problem Date: Fri, 9 Nov 2001 15:28:48 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3be27344$0$227$ed9e5944@reading.news.pipex.net> <3BE42900.7590E899@adaworks.com> <3be65f4c$0$237$ed9e5944@reading.news.pipex.net> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:16170 Date: 2001-11-09T15:28:48-05:00 List-Id: "David Crocker" wrote in message news:3be65f4c$0$237$ed9e5944@reading.news.pipex.net... > 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 ? There is no withing problem. One possible solution appears below. John is confused, and I recommend you disregard his paper. Use gnatchop to extract the sources below. --STX with Patients; use Patients; package body Doctors is procedure Treat_Patient (Doctor : in out Doctor_Type; Patient : in out Root_Patient'Class) is P : Patient_Type'Class renames Patient_Type'Class (Patient); begin null; end; procedure Bill_Patient (Doctor : in out Doctor_Type; Patient : in out Root_Patient'Class) is P : Patient_Type'Class renames Patient_Type'Class (Patient); begin Pay_Doctor (P, Doctor); end; end Doctors; with Patients_Forward; use Patients_Forward; package Doctors is type Doctor_Type is tagged limited null record; procedure Treat_Patient (Doctor : in out Doctor_Type; Patient : in out Root_Patient'Class); procedure Bill_Patient (Doctor : in out Doctor_Type; Patient : in out Root_Patient'Class); end; with Doctors; use Doctors; package body Patients is procedure Visit_Doctor (Patient : in out Patient_Type; Doctor : in out Doctor_Type) is begin Treat_Patient (Doctor, P); end; procedure Pay_Doctor (Patient : in out Patient_Type; Doctor : in out Doctor_Type) is begin null; end; end Patients; with Patients_Forward; use Patients_Forward; with Doctors; use Doctors; package Patients is type Patient_Type is new Root_Patient with null record; procedure Visit_Doctor (Patient : in out Patient_Type; Doctor : in out Doctor_Type); procedure Pay_Doctor (Patient : in out Patient_Type; Doctor : in out Doctor_Type); end; package Patients_Forward is type Root_Patient is abstract tagged limited null record; end;