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,a04e500922557815 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-16 06:04:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Need advice: Enumerate or not Date: 16 May 2002 09:03:25 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3CE2540C.1030404@worldnet.att.net> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1021554627 5370 128.183.220.71 (16 May 2002 13:10:27 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 16 May 2002 13:10:27 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:24184 Date: 2002-05-16T13:10:27+00:00 List-Id: Preben Randhol writes: > On Wed, 15 May 2002 12:26:50 GMT, Jim Rogers wrote: > > The Ada 95 approach is perhaps harder to read, because all the > > decisions are performed by dispatching and not by explicit > > branching in your code. On the other hand, the dispatching > > approach reduces maintenance cost and explicit complexity. > > The only thing I must do is: > > with Some_New_pacakge; use Some_New_pacakge; No, the child package where the actual operation is defined does _not_ need to be visible for dispatching to happen. That is crucial to the dispatching design; the top level Update procedure can be written with _no_ knowledge of what procedures are actually dispatched to. > and make sure that the pacakges supply an update fuction. This is done by making the root operation abstract; then the compiler ensures that each derived type supplies an update function. I suggest you write a very simple application that does dispatching, so you get a better feel for how it works. Model the hierarchy you are thinking of here, but just do Text_IO, so it's easy to get it working. Then you can decide how to proceed with the real application. -- -- Stephe