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-Thread: a07f3367d7,158ce2376534c35d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Derived private interface Date: Fri, 22 Jul 2011 17:59:38 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <27656578-65aa-48b9-9f89-4ebd4e0cb02a@glegroupsg2000goo.googlegroups.com> <0fe3b0f8-c064-444d-899d-640e891b58c3@w4g2000yqm.googlegroups.com> <128d8eb5-1cc6-47e3-a09b-b53a5ef289ce@m10g2000yqd.googlegroups.com> <4e141501$0$6629$9b4e6d93@newsspool2.arcor-online.net> <4b2728fc-6127-45d8-a314-9fc491701c26@g12g2000yqd.googlegroups.com> <82vcve4bqx.fsf@stephe-leake.org> <4e15b223$0$6541$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1311375580 21583 69.95.181.76 (22 Jul 2011 22:59:40 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 22 Jul 2011 22:59:40 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 Xref: g2news2.google.com comp.lang.ada:21270 Date: 2011-07-22T17:59:38-05:00 List-Id: "Jeffrey Carter" wrote in message news:iv80lh$n8m$1@tornado.tornevall.net... > On 07/08/2011 12:23 PM, Randy Brukardt wrote: >> >> This particular problem has no workaround... > > I disagree. The use of programming by composition is an effective work > around to all the problems introduced by programming by extension. Given that the problem in question is related to dynamic dispatching and has nothing in particular to do with extensions, this is an amazing statement. In Claw, the primary reason for using OOP is for the dispatching -- it ensures that every object has handlers for each of the relevant messages, and also provides useful defaults. And it automatically ensures that the right handler is executed for each object -- no manual binding is required. There is some value to extensions in Claw, but not a lot. OTOH, programming by composition would provide nothing, in that there would be no way to change the handlers for the base type. One could graft some sort of unstructured mechanism on top of the objects (possibly using access-to-subprograms), but this would provide many more opportunities for mistakes (if you forget to set the access-to-subprogram value, the routine might as well not exist). Remember that there are four legs to the OOP stool: strong typing, encapsulation, extension, and dynamic dispatching -- and each of these is orthogonal to the others (shown by the fact that Ada has the first two without even using tagged types, that is OOP). So there is no necessary relationship between extension and dispatching (and working around the one does nothing to solve a problem that mainly depends on the other). Randy.