[Pharo-project] Announcer methods are bloated

Stéphane Ducasse Stephane.Ducasse at inria.fr
Wed Apr 20 10:34:15 CEST 2011


On Apr 20, 2011, at 12:00 AM, DougEdmunds wrote:

> I'd vote to keep the subscribe:do: and subscribe:send:to methods, since that
> seems to most clearly identify what they are doing.  

I do not think so. For me subscribe:do: looks like initialization....
Subscribing to something does not mean that you should do something in reaction. 

> Maybe better would be
> subscribeTo:do: and subscribeTo:send:to:
> 
> A good example is the instance var 'announcer' in PragmaCollector which
> holds requests to receive (subscriptions to) 'PragmaAnnouncement' and to
> 'PragmaCollectorReset' announcements. 
> 
> subscribe: anAnnouncement send: aSelector to: anObject
> 	"see Announcements packages"
> 	self announcer subscribe: anAnnouncement send: aSelector to: anObject
> 
> 
> whenChangedSend: aSelector to: anObject
> 	"record a change listener"
> 	self subscribe: PragmaAnnouncement send: aSelector to: anObject
> 
> whenResetSend: aSelector to: anObject
> 	"record a change listener"
> 	self subscribe: PragmaCollectorReset send: aSelector to: anObject
> 
> 
> 
> 
> --
> View this message in context: http://forum.world.st/Announcer-methods-are-bloated-tp3461131p3461644.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
> 




More information about the Pharo-project mailing list