comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Interfaces and abstract tagged types
Date: Thu, 16 Oct 2008 12:05:15 +0200
Date: 2008-10-16T12:05:15+02:00	[thread overview]
Message-ID: <n3k9ijsrk0r8.1kk3b1f2k9zcq$.dlg@40tude.net> (raw)
In-Reply-To: 6a44b25e-07c7-4b3f-9e22-08a778073e4a@q26g2000prq.googlegroups.com

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



  reply	other threads:[~2008-10-16 10:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-05  7:01 Interfaces and abstract tagged types Dale Stanbrough
2008-10-05  7:43 ` Dmitry A. Kazakov
2008-10-05 20:29   ` Robert A Duff
2008-10-06  8:25     ` Dmitry A. Kazakov
2008-10-16  7:51       ` Ivan Levashew
2008-10-16  8:29         ` Dmitry A. Kazakov
2008-10-16  9:23           ` Ivan Levashew
2008-10-16 10:05             ` Dmitry A. Kazakov [this message]
2008-10-16 10:27               ` Georg Bauhaus
2008-10-16 12:21                 ` Dmitry A. Kazakov
2008-10-16 13:35                   ` Georg Bauhaus
2008-10-16 14:30                     ` Dmitry A. Kazakov
2008-10-23  6:39                 ` Ivan Levashew
2008-10-25  8:57                   ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox