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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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 11:01:54 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!154.32.99.10.MISMATCH!psiuk-p2!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: When to use 'Class in a parameter list Date: Tue, 24 Jul 2001 13:16:32 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9jkahi$17u$1@nh.pace.co.uk> References: <9ji1b3$4pi$1@nh.pace.co.uk> <9ji5j7$hlu$1@news.huji.ac.il> <9jjqt0$o1s$1@nh.pace.co.uk> <9jk3lr$ki0$1@news.huji.ac.il> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 995994994 1278 136.170.200.133 (24 Jul 2001 17:16:34 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 24 Jul 2001 17:16:34 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:10530 Date: 2001-07-24T17:16:34+00:00 List-Id: ...And then it hit me like the wet kiss at the end of a fist.... (Lightbulb!) Ahhhhhh! Its all coming back to me as if out of an alcoholic stupor... O.K. This has me pretty much back on track. I want the class-wide flavor if inside the routine I want to generalize some part of the operation and possibly dispatch to other operations that may depend on the specific type of object sent in. I really need to work with this stuff more than once a year... :-) MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Ehud Lamm" wrote in message news:9jk3lr$ki0$1@news.huji.ac.il... > > > The way I explain it to my students is like this "from the 'outside' of the > class-wide routine there no dispatching" (i.e., no dispatching on call to > the class-wide routine), "from the 'inside' you can have dispathcing, by > calling the dispatching operations" (i.e, calls to primitive routine, made > inside the class-wide routine). > Notice that when you call a routine that expect a specific type, from > inside a class-wide routine you are, in a sense, giving a class-wide > actual - and per the table above you may have dispatching. > > Another way at looking at this, is to realize that the class-wide operation > behave the same for all type in the hierarchy, up to calls to dispatching > routines. The commonality is expressed by creating a class-wide routine; the > routine can be sensitive to the differences between the types in the > hierarchy by calling type specific (dispatching) routines. > Aside from the concept of "template function pattern", another common term > is "factoring out common behaviours" - this may give a better idea what's > this all about from a design POV. > > Ehud Lamm > >