The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Just Announce It

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
Just Announce It Posted: Dec 5, 2005 11:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Just Announce It
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement

With two and a half Announcement switches under the belt, I'm noticing something I like. Take the last entry for example. A "StatFeedbackLoop". It queries a data table from some hardware object. The data is rich enough, that it's worth balling up in its own "Stats" object. With the triggerEvent: implementation, it looked something like:

triggerNewStats
	self triggerEvent: #newStats with: self deltaStats

The simplest most straightforward approach to converting a triggerEvent path into an Announcement one, is to take the triggerEvent symbol name, make an Announcement subclass by the same name, add ivars for any with: arguments you need, and move on.

The thing is, why not go a step farther. Just make the "Stats" object an Announcement. Then the code changes to:

announceStats
	self announce: self deltaStats

This pattern of having the with: data become the announcement has happened a couple of times now. And I think it's cool. Really cool. And I can't put my finger on why. But it feels good. When you begin using Announcements, look to have your already existing objects becoming the Announcement.

<Philosophical>
It has begged the question, why have a special Announcement class at all? Why not just be able to announce: any sort of Object? The Announcement class is very lightweight. It has some helper methods which translate pretty directly to meta class queries. The point being, be renaming some Announcements methods, one could move most of them to Object and just go from there (this would of course go against the "unburden Object" philosophy.

The only real state that Announcement offers is the veto stuff. This might be considered a specialization of an Announcement type, rather than the canonical norm. Indeed the presence of isVetoable, and it's default response of false supports this.

In the end, I think everything might become TOO abstract, but it's an interesting thought.

Read: Just Announce It

Topic: Small Fix for BottomFeeder Previous Topic   Next Topic Topic: Pity the poor studio head

Sponsored Links



Google
  Web Artima.com   

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