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,c9629eba26884d78 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-01 20:40:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread4.news.pas.earthlink.net.POSTED!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada References: <3f27bab4$1@baen1673807.greenlnk.net> <3F28F61D.4050504@noplace.com> <3F2A5303.6080902@noplace.com> Subject: Re: XML DOM Binding for Ada 95 - matter of style X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Sat, 02 Aug 2003 03:40:54 GMT NNTP-Posting-Host: 65.110.133.134 X-Complaints-To: abuse@earthlink.net X-Trace: newsread4.news.pas.earthlink.net 1059795654 65.110.133.134 (Fri, 01 Aug 2003 20:40:54 PDT) NNTP-Posting-Date: Fri, 01 Aug 2003 20:40:54 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:41139 Date: 2003-08-02T03:40:54+00:00 List-Id: "Marin David Condic" wrote in message news:3F2A5303.6080902@noplace.com... > > IMHO, something like the DOM - an OOD expression of a desired > functionality - is exactly the reason Ada invented tagged records. The purpose of tagged records is to implement dynamic binding. If the problem calls for dynamic binding, then maybe a tagged type is appropriate (but maybe not). If the problem does not require dynamic binding of operations, then you probably don't need tagged types. > To > implement it with discriminated records (a feature I always found to > have too many "gotchas!" built into it anyway) seems awkward and clumsy. > If you don't think using tagged records to implement something like this > design is appropriate, what are you saving them for? :-) I have never had a problem with discriminated records, so I don't know what "gotchas" you're referring to. Tagged types are one tool among many. Use them when they make sense. It probably doesn't make sense to use a tagged type when there is no dynamic binding. Even when there is dynamic binding, using case statements or subprogram pointers is often simpler. It depends on the problem. Note that the Charles library implements the full view of the container type as tagged, but only to add controlledness to the type, so that memory management is automatic. The partial view of the type is not tagged, and there is no dynamic binding. http://home.earthlink.net/~matthewjheaney/charles/