[MUD-Dev] Re: PDMud (was Re: Bruce Sterling on Virtual Community goals)
Niklas Elmqvist
d97elm at dtek.chalmers.se
Fri Oct 23 16:43:01 CEST 1998
On Fri, 23 Oct 1998, Chris Gray wrote:
> [Niklas Elmqvist:]
>
> [Have to be brief - rushing off to work]
>
> [nice pipes arrangement deleted]
>
> >Or is there a better alternative to a message-based communication system
> >like this? Anyone with more experience in these things than I?
>
> I, and I think some others, have been thinking more in terms of function
> call interfaces than of data stream interfaces. So, the connections would
> more be in the form of a function from, say, the parser module, calling
> functions (via pointer of course!) from the various world modules (magic,
> movement, descriptions, combat, etc.) when the parser has determined
> that the command is a command for that module. In the case of parsing,
> I like the model of only parsing the command once, and working with
> more structured stuff from then on, rather than having more parsing
> happen in other modules. That string stuff is expensive!
Hmm, yes, but when I use the term "message-based" I do not necessarily
mean parsing a string or anything. I guess I've just picked up on the
vocabulary of many O-O authors which like to keep a degree of abstraction
when they talk about objects "passing messages to each other". In reality
(unless you use Smalltalk, I think), this means that one object calls a
method (i.e. a function, just for clarity) on another along with some
arguments. That's the "message".
Also, I probably made things worse by bringing pipes into all this... I am
not thinking about pipes in the OS way where you send raw data streams.
Here, pipes is just a connection between two or more modules to allow one
module to send messages (that is, message info contained in a well-defined
data structure which thus does *not* need to be parsed) to the other
modules.
Having message pipes instead of direct function pointers makes the system
more decoupled (actually, you could view the pipe as a O-O function
pointer abstraction, at least in some sense). Instead of things
potentially breaking when using function pointers which have been
invalidated due to unloaded modules (OK, this should not happen in a good
design), the pipe could intercept and prevent this -- the message just
would not reach its destination. In addition, pipes would allow a module
to broadcast certain messages to several receivers
This may be needlessly complex. However, I strongly feel that it is a much
more conceptually clean solution. In addition, it is also a bit geared
towards an O-O implementation language, so might not be usable depending
on what the consensus is.
> Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
-- Niklas Elmqvist (d97elm at dtek.chalmers.se) ----------------------
"The trouble with being a god is that you've got no one to
pray to."
-- Terry Pratchett, Small Gods
More information about the mud-dev-archive
mailing list