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,4687ad82921cf6ad X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-24 12:40:04 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!lon-transit.news.telstra.net!ken-transit.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!53ab2750!not-for-mail From: Dale Stanbrough Newsgroups: comp.lang.ada Subject: Re: issue with implementing a visitor design pattern References: <100dqeul3pqiua0@corp.supernews.com> User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Message-ID: Date: Sat, 24 Jan 2004 20:38:14 GMT NNTP-Posting-Host: 144.132.42.201 X-Complaints-To: abuse@bigpond.net.au X-Trace: news-server.bigpond.net.au 1074976694 144.132.42.201 (Sun, 25 Jan 2004 07:38:14 EST) NNTP-Posting-Date: Sun, 25 Jan 2004 07:38:14 EST Organization: BigPond Internet Services Xref: archiver1.google.com comp.lang.ada:4784 Date: 2004-01-24T20:38:14+00:00 List-Id: Robert A Duff wrote: > "Robert I. Eachus" writes: > > > The much deeper problem you have is that the Visitor pattern is a waste > > of effort in Ada. Not wrong, or unimplementable, but the pattern as > > such is much heavier weight than it needs to be. > > I agree. In fact, I'd say "visitor" is my least favorite design pattern > of the ones in the Gamma et al book. "Visitor" has all the > disadvantages of a case statement (over dispatching calls), > with none of the advantages! If you have two orthoganal classifications (object and function) and you need to (effectively) double dispatch, the visitor pattern is quite useful. Not quite sure how else you would achieve it in Ada. Dale -- dstanbro@spam.o.matic.bigpond.net.au