[Newbies] Setting up a dependency mechanism in Squeak

Rob Rothwell r.j.rothwell at gmail.com
Fri May 23 21:49:49 UTC 2008


If I understand you right, you could use Announcements...your "dependent
object" registers for Announcements it is interested in, and takes action
when something is announced.

You can see the following for a web type of example, and I could probably
get you started with a simple example as well:

http://onsmalltalk.com/programming/smalltalk/maintaining-loose-coupling-in-seaside-components/

Rob


On Fri, May 23, 2008 at 5:44 PM, David Finlayson <dfinlayson at usgs.gov>
wrote:

> 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
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20080523/ecff6762/attachment.htm


More information about the Beginners mailing list