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,b74ec64483660e21 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-24 07:36:04 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!chnws02.mediaone.net!chnws06.ne.mediaone.net!24.128.8.202!typhoon.ne.mediaone.net.POSTED!not-for-mail Message-ID: <3B5D8819.E9D8AD4E@mediaone.net> From: Ed Falis X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.3 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: When to use 'Class in a parameter list References: <9ji1b3$4pi$1@nh.pace.co.uk> <3B5CDBCA.5810@li.net> <9jjr39$o3l$1@nh.pace.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 24 Jul 2001 14:36:02 GMT NNTP-Posting-Host: 65.96.132.248 X-Complaints-To: abuse@mediaone.net X-Trace: typhoon.ne.mediaone.net 995985362 65.96.132.248 (Tue, 24 Jul 2001 10:36:02 EDT) NNTP-Posting-Date: Tue, 24 Jul 2001 10:36:02 EDT Organization: Road Runner Xref: archiver1.google.com comp.lang.ada:10516 Date: 2001-07-24T14:36:02+00:00 List-Id: Marin David Condic wrote: > > O.K. I think I've got my brain straight about that - maybe the type > conversion that I thought I needed only needed to occur within the child > package in order to force a call back to its parent routine. (Resolving an > otherwise ambiguous call.) > > But that still leaves me a bit confused about when I want to make a > parameter of 'Class. There are two situations I find useful for using classwide parameters. The first is when I want to force that the implementation of a routine will not be overridden by derived type. The second is for implementing a "template pattern", where some overall processing is applied regardless of the specific type of the parameter, and dispatching is used within the routine to handle variation among specific types. For instance, when traversing a tree, certain steps are applied to all nodes, whether internal or leaf, while others depend on the status of the node (composite pattern). So here the traversal operation would use a classwide parameter, while the action applied within it, would dispatch. - Ed