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,e429176c9adb07b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-17 11:06:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: [OT] Best way to isolate a GUI? Date: Mon, 17 Feb 2003 13:06:10 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3E511C15.1040404@acm.org> <3E5121BD.4010200@cogeco.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:34174 Date: 2003-02-17T13:06:10-06:00 List-Id: Warren W. Gay VE3WWG wrote in message <3E5121BD.4010200@cogeco.ca>... >For input and output callback arguments, I use a discriminated record, >which then allows Ada95 checks on record members according to the event >type (ie. the record variation). This is something I wish GtkAda would >use. That doesn't work well if you have callbacks which are evolving (as most real-world GUIs are). Adding a new variant to a record can break existing code (think aggregates, think name conflicts), and will require recompiling everything in sight. What we did with Claw is define a tagged type to hold the client data. Then an extension of it can hold any possible callback's data, including those that aren't defined yet. The data parameter is then a class-wide object of the tagged type. The checking, like the variant record's, is at runtime (because you'll need an explicit conversion to the appropriate type in order to read the components). But the checking is (usually) cheaper, because it occurs in only one place, and it requires less code if the variant is at all complex. Randy.