[MUD-Dev] Object Models
david.l.smith at home.com
david.l.smith at home.com
Thu Nov 16 17:00:13 CET 2000
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 at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list