[DGD] data inheritance: multiple vs single ancestry
Jared Maddox
absinthdraco at gmail.com
Sat Mar 23 03:18:10 CET 2013
> Date: Thu, 21 Mar 2013 18:40:12 -0700
> From: Raymond Jennings <shentino at gmail.com>
> To: "All about Dworkin's Game Driver" <dgd at dworkin.nl>
> Subject: [DGD] data inheritance: multiple vs single ancestry
> Message-ID:
> <CAGDaZ_pnH2m9TZe-_O8h=Y4fjFwug0=5+TdEV=za1aqv6uuEnA at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Ok, just curious about this:
>
> Phantasmal has "archetypes" where properties and things can be
> inherited from multiple ancestors. In some cases, the prime ancestor
> (first on the list) is used for stuff that can't be aggregated,
> whereas things like nouns and adjectives can be inherited from every
> parent.
>
> However, SkotOS as you know has only a single "ur (you are)" pointer
> and data inheritance is forcibly singular.
>
> Is it better to allow multiple ancestry, or are things better off with
> the simple model where you can only have one parent?
>
I'm a bit late to this conversation, but here's my two cents:
As someone who's played around with designing programming languages
before, I say that if you're going to have ACTUAL inheritance, then
you should have multiple inheritance (and DGD's ability to name the
parents is a good feature).
If you think you want SINGLE inheritance, then you probably ACTUALLY
want interfaces that'll delegate actions back to your object. In some
ways it's more flexible than inheritance, though in other ways not.
And then there's C++-whenever-they-get-around-to-it's "concepts",
which will be similar, except that they won't exist at run-time, or
SOMETHING like that.
And for the record, I currently favor interfaces. Using a "proper"
object for implementation, and one or more separate "interface"
objects for usage, forces a nice, "clean" separation of concerns
(especially if you realize that you need to change an API after it's
already been used, and want to do it incrementally ;) ). If you really
want to extend another object's API then you can just create an
interface that does that.
More information about the DGD
mailing list