comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@notmyhomepage.invalid>
Subject: Re: Simple example on interfaces
Date: Tue, 26 Jan 2021 08:33:53 +0100	[thread overview]
Message-ID: <ruogl1$gr7$1@dont-email.me> (raw)
In-Reply-To: <runfcf$1uub$1@gioia.aioe.org>

On 25.01.21 23:06, Dmitry A. Kazakov wrote:

>> That is forbidden as far as the final application is concerned. The example I posted here is a simplification of a more complex scenario.
> 
> There exist various dirty tricks to emulate full multiple inheritance but no universal solution. If you really need full multiple inheritance, choose the most important path of implementations and make types along it proper types. Other paths if simple, could tricked using
> 
> - Min-in inheritance
> - Generic packages to automate implementation of interfaces
> - Memory pools to inject implementation
> 
> Nothing of these is good. They basically work only if the depths of the secondary inheritance paths is 1.
> 

(Mix-in inheritance?)

Composition can be a good alternative, too.
It can help making the type graph modular.
It naturally adds separation of concerns.
Is there good reason to prefer Is-A over Has-A?
If all the types are related through inheritance,
will refactoring become easier or harder?

  reply	other threads:[~2021-01-26  7:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 16:08 Simple example on interfaces Mario Blunk
2021-01-25 16:41 ` Dmitry A. Kazakov
2021-01-25 17:51   ` Mario Blunk
2021-01-25 22:06     ` Dmitry A. Kazakov
2021-01-26  7:33       ` G.B. [this message]
2021-01-26  8:07         ` Dmitry A. Kazakov
2021-01-26  8:17           ` Mario Blunk
2021-01-26  8:55             ` Dmitry A. Kazakov
2021-01-26  9:37       ` J-P. Rosen
2021-01-26 10:25         ` Dmitry A. Kazakov
2021-01-26 11:15           ` AdaMagica
2021-01-26 11:53             ` Dmitry A. Kazakov
2021-01-26 16:46               ` AdaMagica
2021-01-26 19:44                 ` Dmitry A. Kazakov
2021-01-26 20:04                   ` Shark8
2021-01-26 21:34                     ` Dmitry A. Kazakov
2021-01-27  3:11                     ` Randy Brukardt
2021-01-27 22:51                       ` Shark8
2021-01-30  8:33                         ` Randy Brukardt
2021-01-27  3:09                   ` Randy Brukardt
2021-01-27  8:05                     ` Dmitry A. Kazakov
2021-01-26 10:02     ` Stephen Leake
2021-01-25 17:00 ` Jeffrey R. Carter
2021-01-27  1:48   ` philip...@gmail.com
2021-01-27  8:06     ` Dmitry A. Kazakov
2021-01-27  3:36   ` Randy Brukardt
2021-01-27 23:04     ` Shark8
2021-01-25 19:05 ` Stephen Leake
replies disabled

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