swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Probing: notification of target


From: Scott Christley
Subject: Re: Probing: notification of target
Date: Fri, 23 Jan 1998 16:17:24 -0800 (PST)

I don't have the Swarm code in front of me so hopefully someone can fill
in this point, how does the probe alter the data field in the swarm
object?  Does it directly modify the instance variable or does it use an
accessor method? 

If it uses an accessor method then that's your answer, the swarm object
knows because the method was called.

This is a general problem of observersation; though usually it is the
other way around.  There are a number of observers who are
waiting for something to occur; yet the object (which is the cause of the
distrubance) knows nothing about (and should not!) these observers.

OpenStep solved this problem by implementing notifications.  There is a
NotificationCenter, a NotificationQueue, and Notifications.  The
NotificationCenter manages a NotificationQueue; observers tell the
NotificationCenter what notifications they want to be informed of.  When a
distrubance occurs, a notification is created with a name, id to the
object in question, and a notification specific id; and the notification
is posted to the center where it is sent out to the observers.

In the OpenStep model, the NotificationCenter operates in synchronous
fashion but you can imagine an asynchronous implementation, which gives
the ability to model time-delay affects for information to flow through a
system.

So with notifications, the probemap would post the notification, and the
observers would get informed; one of the observer could be the object
itself!

Scott

 On Fri, 23 Jan 1998, Sven N. Thommesen wrote:

> 
> All:
> 
> I have just gone through all the docs for probes in the 1.0.5 docs, and I
> don't see the immediate answer to a question I have, so I pass it on to the
> list in the hopes that someone has thought about this before:
> 
> Say I have a standard GUI probemap on the ModelSwarm open during execution.
> Say I alter a data value using the probe display. This will alter the
> relevant data field in the swarm object, but does the swarm object become
> cognizant of the fact that a change has taken place? Let's say that if a
> certain variable is altered, the ModelSwarm needs to propagate the change
> to other objects, or perhaps to destroy or create objects. How do I notify
> the target of a probe that a value has been changed ? (*)
> 
> As far as I can see, there is no builtin mechanism for this. I *could*
> define special messages on the target swarm to be used only by probes, but
> then I would need an object that would send those messages, and I'd need a
> gui probe on *that* object, and then the question is how does *that* object
> notice that a data variable has changed ...
> 
> I'm stumped!
> 
> --Sven
> 
> (*) I'm looking for the objective-C version of 'tell his lawyer' :-)
> 
> 
>                   ==================================
>    Swarm-Support is for discussion of the technical details of the day
>    to day usage of Swarm.  For list administration needs (esp.
>    [un]subscribing), please send a message to <address@hidden>
>    with "help" in the body of the message.
>                   ==================================
> 



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]