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,4b3c1a8f7db90f9 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.belwue.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Interfaces and abstract tagged types 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: <1w8x4i0peinwk$.16cenhvch5kv5.dlg@40tude.net> <6a44b25e-07c7-4b3f-9e22-08a778073e4a@q26g2000prq.googlegroups.com> Date: Thu, 16 Oct 2008 12:05:15 +0200 Message-ID: NNTP-Posting-Date: 16 Oct 2008 12:05:15 CEST NNTP-Posting-Host: a9551f75.newsspool4.arcor-online.net X-Trace: DXC=[ac1DL0\iNk016@cHD@m;j4IUKoTZ``FiSM4?b X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2411 Date: 2008-10-16T12:05:15+02:00 List-Id: On Thu, 16 Oct 2008 02:23:46 -0700 (PDT), Ivan Levashew wrote: >> Maybe, because I am right? (:-)) > > As for me, it's because it takes much time to get how to use every of > 3 cases. These 3 cases represent an implementation view on inheritance. As such this classification contradicts to the fundamental concept of separation interfaces and implementations. If an implementation choice (the case number) forces you to change the interface, then the language design is broken. With all respect to Tucker Taft, the text you refer to is merely an excuse for a language design fault. >> reality. As I described in my >> previous post, we have a growing amount of code >> that is just noise. > >> type A_Interface is limited interface; >> procedure Foo (X : A) is abstract; >> type A is abstract ... and A_Interface with ...; >> overriding procedure Foo (X : A); > > A code duplication ratio is expected to be > between 2:1 and 3:1. Is it noise? Yes, per definition: a thing without semantic meaning is noise. > Did your team use generic mix-ins? Yes. You need to move implementations down the inheritance tree, because upper nodes are interfaces: A <-- B1..BN <-- C1..CM This multiplies the same code by the factor of W**D where W is the tree width and D is the tree depth. In order to handle this exponentially exploding code, generics are introduced down the tree. I.e. Bi becomes a generic and interfaces are passed as formal parameters of. Then the generic instances are passed down the tree to lower generics. You get the idea... The perversion is that inheritance as form of polymorphism is technically replaced by another form of (parametric polymorphism). What are interfaces for, if generics must be used instead? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de