[MUD-Dev] Room-based vs. coordinate-based

Shawn Halpenny malachai at iname.com
Fri Jun 13 09:34:16 New Zealand Standard Time 1997


clawrenc at cup.hp.com wrote:
> 
> Shawn Halpenny <malachai at iname.com> said:
> > clawrenc at cup.hp.com wrote:

[ any change in object sends notification ]

> >> This allows a watcher to trigger on a state change for a private data
> >> member in an object.  Depending on the strictness of your views on
> >> data encapsulation, this can be thought of as a Good Thing, or a Bad
> >> Thing.
> 
> >Watchers can trigger on private data changes by not defining exactly
> >what they're watching, but choosing to watch for a change in any
> >property.  So I still maintain the low message traffic for watchers
> >waiting on a few properties, and don't have to cheat my encapsulation
> >by allowing watching on the entire object if desired.
> 
> This raises an implementation question:
> 
>   if your watchers are specified with a definition of what they are
> watching, this suggests that a single watcher could be watching
> several attributes at the same time.

That's correct.  A single watcher can wait on any number of attributes
in a single object.

> Does this mean that an entry is made on the "watch list" for each of
> those attributes, or does it mean that upon a change, that change is
> compared to the object's list of watcher filters, and the approriate
> messages sent?  The latter case seems wasteful (tho better than the
> broadcast everything approach) if true.  The former gets data space
> hungry.

It is the latter.  There is, of course, a point where it is cheaper to
watch
for change on the entire object, rather than changes in many
attributes.  I haven't defined the actual implementation yet, but I
anticipate these watcher filters to be somewhat wildcard-able (ATM all
my attributes are defined by string names), so a single watcher can
easily and efficiently monitor a number of related attributes.  This
optimization will depend on the composition of the attribute names, but
those are something that can be easily tweaked.

--
Shawn Halpenny

"You can't buy the necessities of life with cookies"
                                    - "Edward Scissorhands"



More information about the MUD-Dev mailing list