[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

15744: RE: [MUD-Dev] Object Models

[Full Header] [Plain Text]
From: david.l.smith@home.com
Newsgroups: nu.kanga.list.mud-dev
Date: Thu, 16 Nov 2000 17:00:13 -0500
References: [1]
Organization: Kanga.Nu
If you want to look at this from a non-multiple inheritance standpoint, one
possibility is to replace the inheritance with various collaborations.
Essentially, this means that instead of an Object C _being_ also an object A
and B (multiple inheritance), the Object C _has_ an Object A and/or B.

This collaboration scheme has some advantages. First, it reduces the
possibility of name ambiguity (A.x() or B.x()?...). Second, it decreases
Type (class/object) proliferation. However, it does seriously damage
type-safety (usually the collaboration is done via a pointer either to a
base class shared by A and B, or via a void-pointer -- runs in horror.)

Anyone reading this will realize that you're essentially creating virtual
function tables on the fly for objects usiing collaboration. Yes, this
closely mimics the mechanism of multiple inheritance, but it does allow a
finer grain of control, which may ultimately be desireable.

-Dave



_______________________________________________
MUD-Dev mailing list
MUD-Dev@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev