[Seaside] Re: Menu component - communicating with root component

Sebastian Sastre ssastre at seaswork.com
Mon Apr 21 11:39:36 UTC 2008


> 
> I'm faced with this problem now.  I want the grandparent component to
> respond to the announcement -- would my idea of having a generic
> mechanism to bubble the announcements up the component tree be the way
> to go - like html dom events.
> 

The bubble of events is a poor idea invented for technologies in which, unlike
Smalltalk, you cant make any arbitrary object to have arbitrary events wired and
triggered. Please don’t feel you are limited like that because you don't.

To paliate that limitation they just creatively invented that events should
"bubble" at the price of having to deal with a whole new problem: explicit
filtering of events when a component should not react. Do you see how absurdly
expensive this is?

In the other hand, using Announcements ala events, you have a simple approach
which mimics real life: 

Announcement/Event: 

	street announce: SemahoreLightWentRed

Driver (reaction) #onRedLight   
	self stopVehicle

Every driver, with a honest license, is expected to have wired that reaction to
the red light event but (wired) only for the semaphore which is just in front of
the vehicle and no others. He/she does not have to be stressed having to filter
all semaphores going red in the neighbourhood not to mention the city and so on
(global things smells). 

Which could possible be more simple yet scalable than that?

This model has proven good for decades in N Smalltalk environments. Why innovate
injecting the irrelevant?

Cheers,

Sebastian
PS1: I found relevant the quote I recently saw in Newspeak presentation:
"A programming language is low level when its programs require attention to the
irrelevant", Alan Perlis

PS2:  Bubbling will be like making the cooling system of the car to also receive
the red light of the semaphore in the street. This reminds me to that joke of
what would happen if Microsoft starts making cars...



More information about the seaside mailing list