The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Getting Announcements

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Getting Announcements Posted: Apr 5, 2007 11:35 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Getting Announcements
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Back when Vassili first started talking about Announcements, I really didn't see the point - I had just switched BottomFeeder over from change/update to Trigger Events, and those seemed sufficient. Now that I've been working with Widgetry (Swallow), I see what the advantage is. Consider a trigger event that notifies you of a keyboard event:

Subscribing:


someObject when: #keyboardEvent send: keyboardEvent: to: self

This depends on the triggering object sending an argument along:


kbdHandler triggerEvent: #keyboardEvent with: keyboardEventObject

Which is fine, except for one thing - the object being sent is sent more or less simply by convention, and the triggering object has to send it along. Now consider the way an Announcement works:

Subscribing:


	(self paneAt: #input) inputField 
		when: KeystrokeAboutToBeProcessed
		send: #possibleCREvent:
		to: self.

What do I expect to see as the argument? An instance of the KeystrokeAboutToBeProcessed class - so instead of pushing symbols around, we push full objects around. This particular one is sent like this:


targetPane 
	announce: (KeystrokeAboutToBeProcessed keyboardEvent: aKeyboardEvent)

The nice thing is, we've moved "up" a level from symbols to objects. None of that was clear to me back when I read about it - it's like an "aha moment" all over again.

Technorati Tags:

Read: Getting Announcements

Topic: Well done Mr Jobs, but��� Previous Topic   Next Topic Topic: The Twitter Fix is in!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use