[DGD] data inheritance: multiple vs single ancestry

Kris Van Hees aedil at alchar.org
Fri Mar 22 04:04:02 CET 2013


It is an interesting question, and one that does not have a real answer.  There
has been quite a bit of discussion in the OO world on the benefits and pitfalls
of multiple inheritance.  In the end, a lot boils down to how you envision your
own object model to be constructed.

E.g. while many people really prefer the single inheritance object model, it is
often based on experience with other languages that do OO without multiple
inheritance, or some other influence, and some simply stick to what they believe
to be a purist OO view.

But (assuming a MUD context), why would it be unreasonable to consider objects
in terms of whether they have an environment and/or an inventory.  You can find
a few different combinations:

- Outdoor locations have an inventory but no environment
- Items that can be carried have an inventory but no environment
- Unless they are items that can contain other items (like a bag)
- Some objects do not have an environment, nor do they have an inventory

So, in this type of model, multiple inheritance definitely pops up in being
able to express that an object belongs to more than one distinct group:
objects that have an environment, and objects that have an inventory.  It is
of course possible to model this using single inheritance, but then you are
tailoring your model to fit an arbitrary restriction in OO design rather than
designing a object model based on single inheritance...

	Cheers,
	Kris

On Thu, Mar 21, 2013 at 06:40:12PM -0700, Raymond Jennings wrote:
> 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?
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd

-- 
Never underestimate a Mage with:
 - the Intelligence to cast Magic Missile,
 - the Constitution to survive the first hit, and
 - the Dexterity to run fast enough to avoid being hit a second time.



More information about the DGD mailing list