[MUD-Dev] Object and class heirarchies -- are they really necessary?

cg at ami-cg.GraySage.Edmonton.AB.CA cg at ami-cg.GraySage.Edmonton.AB.CA
Tue Mar 28 19:39:49 New Zealand Daylight Time 2000


[Phillip Lenhardt <philen at funky.monkey.org>:]

> For example, if a door is just a regular object with open and close
> methods and link attributes pointing at two other roomish objects,
> how do you determine if it is a door at all? In a class hierarchy,
> you can ask for the class or type of an object. If that class or
> type is or is descended from the door class, you know you have a
> door object. With just a base class, you have to check for all
> relevant methods and attributes before treating that object like
> a door.

I recall someone on this list (JCL?) saying something analagous to:

    If it acts like a door, its a door.

Why do you care if the way it gets its door behaviour is by being an
"official" door? If someone has, within the rules of your world, created
a non-door object which is intended to act like a door, then I would
think you would want everyone to treat it as if it were a door. In other
words, you don't want anyone to be able to find out that it isn't "really"
a door.

Possibly there are some rare administrative cases where you want to be
able to identify "official" doors, but should that kind of requirement
drive the basic heart of your system?

--
Don't design inefficiency in - it'll happen in the implementation.

Chris Gray     cg at ami-cg.GraySage.Edmonton.AB.CA
               http://www.GraySage.Edmonton.AB.CA/cg/



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



More information about the MUD-Dev mailing list