[Newbies] Setting up a dependency mechanism in Squeak

David Finlayson dfinlayson at usgs.gov
Fri May 23 21:44:04 UTC 2008


In the Art and Science of Smalltalk by Simon Lewis, there is a lengthy
discussion of Smalltalk's dependency mechanism (yourObject
addDependent: myObject; myObject changed, etc.) . A few of the
examples of Morphic (Squeak by Example, Squeak: Object Oriented Design
with Multimedia Applications) show examples sending the "changed"
message which I assume triggers a dependency update the same as or
similar to the dependency mechanism described by Lewis. But the
examples are too trivial to see this through completely. Is this still
the way to set up a many-to-one dependency relationship between
objects in Squeak?

My program is pretty simple: I am creating a navigation display for a
boat. The boat's position and other interesting variables are
transmitted to the program via UDP packets over the network and these
are visualized in the user-interface by a set of widgets (which the
pilot can pick from and move around). I plan on having a master object
that contains the latest information from the various UDP packets and
I want the widgets to depend on the master, so that when (for example)
the position of the boat is updated, the little widget representing
the boat moves appropriately. All of this is obviously do-able (and
not too different than Etoys), but I'm still learning how to set it up
in Squeak.

Thanks for any advise.

David


More information about the Beginners mailing list