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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news.musoftware.de!wum.musoftware.de!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Preventing type extensions Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <87iq2bfenl.fsf@mid.deneb.enyo.de> <874odv9npv.fsf@ludovic-brenta.org> <87y6b7cedd.fsf@mid.deneb.enyo.de> <66a3704c-54f9-4f04-8860-aa12f516134b@t3g2000vbb.googlegroups.com> <87d3sib44t.fsf@mid.deneb.enyo.de> Date: Mon, 13 Sep 2010 09:13:43 +0200 Message-ID: <134q4k2ly2pf4$.17nlv1q6q5ivo.dlg@40tude.net> NNTP-Posting-Date: 13 Sep 2010 09:13:40 CEST NNTP-Posting-Host: 280642c4.newsspool2.arcor-online.net X-Trace: DXC=\5R>V`Tmk@2QbA1[CgMQ00A9EHlD;3Yc24Fo<]lROoR18kF7enW;^6ZC`4\`mfM[68DC3g>9`8=iT@18 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:14034 Date: 2010-09-13T09:13:40+02:00 List-Id: On Mon, 13 Sep 2010 07:32:02 +0200, Florian Weimer wrote: > * Maciej Sobczak: > >> If it implements an abstract interface, then why extending it further >> is a problem? From the user point of view (that is, from the point of >> view of the subprogram that accepts Some_Interface'Class and operates >> on it), it does not matter how deep is the hierarchy. > > Type extensions break encapsulation (at least if there non-abstract > dispatching subprograms which contain some non-trivial code): the > information which subprograms call each other under what circumstances > leaks to the outside of the package. One very drastic way to > implement that is to disallow type extensions for most non-abstract > types you write, and consider the exceptions carefully. No, the actual problem here is re-dispatch. Just do not do that, it is always bad. Final classes make no sense. I am glad that at least this was not borrowed by Ada ... yet. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de