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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,158ce2376534c35d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!h17g2000yqn.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Derived private interface Date: Sat, 23 Jul 2011 02:29:51 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5035ab5f-a402-4044-8fec-1dbbfbadd26a@h17g2000yqn.googlegroups.com> 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: 83.3.40.82 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1311415034 27240 127.0.0.1 (23 Jul 2011 09:57:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 23 Jul 2011 09:57:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h17g2000yqn.googlegroups.com; posting-host=83.3.40.82; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:21289 Date: 2011-07-23T02:29:51-07:00 List-Id: On Jul 23, 9:30=A0am, Jeffrey Carter wrote: > The equivalent of dispatching in programming by composition is a subprogr= am that > contains a case statement that contains calls to other subprograms. The whole point of dispatching is to allow the open-closed principle: http://en.wikipedia.org/wiki/Open/closed_principle It has no direct equivalent in programming by composition. > No > access-to-subprogram values involved. Access-to-subprogram is needed to emulate dispatching and provide the open-closed principle at the same time. > It does the exact same thing as > dispatching, except that it's easier to read and understand and doesn't r= esult > in large numbers of "what am I doing wrong?" Without dispatching (and without access-to-subprogram to emulate it) you would have large number of "why should I modify half of my drawing application code just because I have added a rectanlge-with-rounde- corners". -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com