[Home] [Groups] - Message: [Prev in Group] [Next in Group]
681: Re: [MUD-Dev] Room-based vs. coordinate-based
[Full Header] [Plain Text]
From: clawrenc@cup.hp.com
Newsgroups: nu.kanga.list.mud-dev
Date: Thu, 12 Jun 97 15:28:27 -0700
References: [1]
Organization: Kanga.Nu
Shawn Halpenny <malachai@iname.com> said:
>clawrenc@cup.hp.com wrote:
>>Shawn Halpenny <malachai@iname.com> said:
>> Ahh. I don't have any sort of filtering or definition of watchers. A
>> watcher just triggers whenever an object changes. The result is a
>> message sent to the waiting object of the form, "I HAVE CHANGED". I
>> then leave it up to the waiting object to figure out what changed, and
>> if they are interested in that change.
>A watcher will only trigger if the correct property (or properties)
>changes so that the watching object isn't deluged by messages about
>state changes it doesn't care about on busy objects. The waiting
>object only has to decide what to do with the change, since it only
>gets messages concerning the things it cares about.
Yeah, its an obvious optimisation. The reason I don't do it at the
moment is that the insides of objects (methods, attributes etc) are
opaque. I just don't have a decent way to tie anything in there
without warping the design.
>> 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.
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.
--
J C Lawrence Internet: claw@null.net
(Contractor) Internet: coder@ibm.net
---------------(*) Internet: clawrenc@cup.hp.com
...Honorary Member Clan McFUD -- Teamer's Avenging Monolith...