[MUD-Dev] [DGN] [NEWBIE] Suggestions on (OO) Server Design.

Kwon Ekstrom justice at softhome.net
Thu Apr 4 11:52:17 New Zealand Daylight Time 2002

From: "Pure Krome" <muddev at world-domination.com.au>

> I'm new to the list, so i'll start by apologising if this thread
> has been raised a number of times.

That's not a big deal... every time a subject is brought up new
ideas get hatched.

>   To start the ball rolling, I've been trying to get my head
>   around the concept that in a mud, the objects, NPC's, PC's and
>   even rooms are all derived from a THING, and broken down into
>   more specialised children as you go down.  I'm wondering if
>   other people have designed such muds being this abstract, yet
>   working?

>    Thanks in advance to anyone for any support, ideas and
>    critisisms.

My mud is written in java, and uses a form of this, Java allows
multiple inheritance in the form on interfaces.  I have a Token
interface which defines things necessary for all mud objects, Mobs
(Creatures in my system) and Items (Objects, the keyword is reserved
and Item is more descriptive imo).

I have an abstractToken which provides a default implementation of
Token, which is extended by Room and NamedToken, NamedToken provides
methods and fields to handle an object with names (as the name
implies).  Creature (Mobiles) and Item (Objects) extend NamedToken.

This is a basic overlay on how things work... Token itself defines
very little, almost all of it's functionality comes from interfaces
that it extends.

Note, this is a Java model, and it works quite well.  By abstracting
everything into interfaces you can write code to the lowest common
denominator.  I don't have any performance issues stemming from
this, most of my performance issues come from IO.  (I'm fixing to
update the IO to the java.nio package)

Here's a basic fork of my heirarchy.

Java only supports single inheritance, with multiple interfaces...
By the time they get to NamedToken there's about a dozen interfraces
that get inherited.


-- Kwon J. Ekstrom

MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list