2000Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Object and class heirarchies &#45;&#45; are they reallynecessary? -->
<!--X-From-R13: Znmnehf <ynmnehfNbhecynpr.bet> -->
<!--X-Date: Mon, 27 Mar 2000 13:19:12 &#45;0800 -->
<!--X-Message-Id: Pine.LNX.4.05.10003271216010.18002&#45;100000#builder,ourplace.org -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: E12XVws&#45;0001DB&#45;00#under,eng.cp.net -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Object and class heirarchies -- are they reallyn</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:lazarus#ourplace,org">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00744.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00745.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00683.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00748.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00743">Author</A>
&nbsp;|&nbsp;<A HREF="#00743">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00743">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Object and class heirarchies -- are they reallynecessary?</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Object and class heirarchies -- are they reallynecessary?</LI>
<LI><em>From</em>: Lazarus &lt;<A HREF="mailto:lazarus#ourplace,org">lazarus#ourplace,org</A>&gt;</LI>
<LI><em>Date</em>: Mon, 27 Mar 2000 12:45:36 -0800 (PST)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Are they necessary?  I say yes.  Are the complex multiple-inheritance
models many propose necessary?  I think not..

On Tue, 21 Mar 2000, J C Lawrence wrote:

&gt; 
&gt; I recently went over to chat with the Skotos gang.  One of the
&gt; things that came up was the handling of object heirarchies.
&gt; 
&gt; Most of the OO-ish MUD designs out there have well developed class
&gt; hairarchies with (often) dozens of classes related in variously
&gt; complex fashions by a rather detailed inheritance tree with
&gt; individual objects being descendents of some highly refined (in
&gt; inheritance terms) branch of the tree.  Its a well known and
&gt; excercised approach with a lot of prior art and well known problems
&gt; (eg trying to fit a new class into such a tree that attempts to
&gt; assemble features of widely seperated branches can be a bitch).

Been there, done that.  Thrown it away several times for exactly that
reason.  I do wish in addition to being 'well known and exercised' it were
also well documented so the rest of us did not have to learn the falicy of
the approach the hard way.

&gt; 
&gt; The Skotos guys (mostly Christopher Allen) made the point that at
&gt; Skotos they instead essentially have only one object type, and
&gt; everything is then an instance of that type.  Thus player
&gt; characters, NPCs, swords, rooms, bricks, pebbles, trees, sacks, etc
&gt; etc etc are actually all instances of the same super-class with the
&gt; only actual variance among them being in the values of the data
&gt; attributes of each object.  Thus, yes, it is trivial to walk inside
&gt; your sword, fly a banana, pick up a room and throw it in the bin,
&gt; etc and so forth.  The only actual differences are the internal data
&gt; values, and thus the _reactions_ of all the available methods.

This is where I wound up.  My latest design concluded with a base class of
'mud_thing' from which everything else was derived.  I thought it was cute
to pick up my test character (could be used for trouble makers as well)
and put him in my pocket.

&gt; 
&gt; This surprised me as I'd been tending in that direction myself
&gt; without ever having noticed.  My object trees have been getting
&gt; simpler and simpler, with less and less internal structure,
&gt; following this trend quite closely withuot ever noticing it.  Its
&gt; almost at the point now where the only reason for having a class
&gt; heirarchy is for logical clarity (so I don't have one huge class
&gt; definition with 3,000 methods).  I then assemble my very simple
&gt; class heirarchy from these easily omprehendable components into a
&gt; small number of super-classes, and then descend my objects from
&gt; there.

Welcome to the enlightened..  I thought I was one of the few who came to
the inevitable conclusion of this line of reasoning.  I gotta talk to
these Skotos folk since it seems they have got it right.

&gt;   ie My inheritance tree fans out into many small banrches, and then
&gt; the branches then collect back together again (multiple inheritance)
&gt; to produce the super classes.

Not wanting to start a religious war, but no way to say it any other way,
it has been said that multiple inheritance is the crutch of a poorly
designed class structure..  about half way between 'goto' and 'void
casting'.  I think I have tried (and rejected) over a dozen different
class heirarchies on our diku hack and slash mud and have concluded the
same thing you are realizing.  Rooms, objects, characters ..  all of these
are 'mud_things'.  They may contain other mud_things.  They may be
contained within other mud_things.  They all have the same basic
properties.  They all have a large number of common attributed/methods.  
Things are never the same once you start to think of OLC as 'picking this
room up and carying it to somewhere else'.  The use of a master
'mud_thing' class also fits the KISS rule far better than any of the other
implementations I have seen.

The FAQ of this list says that interitance trees are a topic of this list
and I find it interesting that noone has presented in detail thier design.
I am glad you brought up a point that has bothered me for several years
with regards to why everyone seems to feel it necessary to make a dogs
breakfast of trees for what intuatively seems a very simple structure.

&lt;snip a lot of good stuff&gt;

&gt; 
&gt; When your entire inheritance tree (from an object's perspective) is
&gt; that you all descend from the same super-class -- how do you handle
&gt; multi-user security and access controls for editing the consituent
&gt; components of that super-class?
&gt; 

What is your question?  You handle security of any instantiation the same
independant of whether it is multiply derived from multiple base classes
or derived from a single super class.  Or, are you proposing online
editing of the base class definition?  Now that would be one heck of a can
of worms.





_______________________________________________
MUD-Dev mailing list
MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00748" HREF="msg00748.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>
<ul compact><li><em>From:</em> Kevin Littlejohn &lt;darius#connect,com.au&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00675" HREF="msg00675.html">[MUD-Dev] Object and class heirarchies -- are they really necessary?</A></STRONG>
<UL><LI><EM>From:</EM> J C Lawrence &lt;claw#cp,net&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00744.html">Re: [MUD-Dev] Trouble Makers or Regular Citizens</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00745.html">Re: [MUD-Dev] Trouble Makers or Regular Citizens</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00683.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00748.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00743"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00743"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00695" HREF="msg00695.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>, 
J C Lawrence <a href="mailto:claw#cp,net">claw#cp,net</a>, Wed 22 Mar 2000, 23:14 GMT
<UL>
<LI><strong><A NAME="00706" HREF="msg00706.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>, 
Phillip Lenhardt <a href="mailto:philen#funky,monkey.org">philen#funky,monkey.org</a>, Thu 23 Mar 2000, 06:14 GMT
</LI>
</UL>
</LI>
</ul>
</ul>
<LI><strong><A NAME="00681" HREF="msg00681.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>, 
Kevin Littlejohn <a href="mailto:darius#connect,com.au">darius#connect,com.au</a>, Wed 22 Mar 2000, 00:25 GMT
</LI>
</ul>
<LI><strong><A NAME="00683" HREF="msg00683.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>, 
Chris Jones <a href="mailto:cjones#v-wave,com">cjones#v-wave,com</a>, Wed 22 Mar 2000, 00:49 GMT
</LI>
<LI><strong><A NAME="00743" HREF="msg00743.html">Re: [MUD-Dev] Object and class heirarchies -- are they reallynecessary?</A></strong>, 
Lazarus <a href="mailto:lazarus#ourplace,org">lazarus#ourplace,org</a>, Mon 27 Mar 2000, 21:19 GMT
<UL>
<LI><strong><A NAME="00748" HREF="msg00748.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>, 
Kevin Littlejohn <a href="mailto:darius#connect,com.au">darius#connect,com.au</a>, Tue 28 Mar 2000, 01:06 GMT
<UL>
<LI><strong><A NAME="00754" HREF="msg00754.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>, 
Marian Griffith <a href="mailto:gryphon#iaehv,nl">gryphon#iaehv,nl</a>, Tue 28 Mar 2000, 19:36 GMT
<UL>
<LI><strong><A NAME="00773" HREF="msg00773.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>, 
Kevin Littlejohn <a href="mailto:darius#connect,com.au">darius#connect,com.au</a>, Wed 29 Mar 2000, 00:35 GMT
<UL>
<LI><strong><A NAME="00777" HREF="msg00777.html">Re: [MUD-Dev] Object and class heirarchies -- are they really necessary?</A></strong>, 
J C Lawrence <a href="mailto:claw#cp,net">claw#cp,net</a>, Wed 29 Mar 2000, 01:31 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>