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: 103376,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!news-2.dfn.de!news.dfn.de!news.uni-stuttgart.de!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Preventing type extensions Date: Mon, 13 Sep 2010 07:32:02 +0200 Message-ID: <87d3sib44t.fsf@mid.deneb.enyo.de> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: idssi.enyo.de 1284355922 5341 172.17.135.6 (13 Sep 2010 05:32:02 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:KJTjLAt9A+ggm3nl3jVvRfuUP7M= Xref: g2news1.google.com comp.lang.ada:14033 Date: 2010-09-13T07:32:02+02:00 List-Id: * 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.