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

Sebastian Sastre ssastre at seaswork.com
Mon Apr 21 11:05:44 UTC 2008

> Peeking at grandchildren is IMHO even worse than accessing a parent. 
> It's the same princicple (traversing the component 
> hierarchy), just more 
> laborious.
+1 here.

> >> So menuItemB, performs "self announce: (anAnnouncement)" on 
> >> an announcer.
> >>
> >> ok... where is this announcer? How does it know about it?
> > 
> > Put it on the session and then every component has access 
> to a single global
> > announcer.
> Using the session as global variable dump and central router for 
> application logic isn't very auspicious, too.
> I faced a similiar problem recently, and initially used the 
> give-components-its-parent-but-only-use-it-for-announcing-approach. 
> however, it was doomed once I had to announce events between siblings.
> Subscribing each and every component with potentially a lot of other 
> components didn't look very promising, too.

That's why I'm using one announcer per component. When you have that
announcements are naturally filtered at the source (exacly as usual events in
any Smalltalk) and everything remains at the same simplicity no matter how many
components, wirings and reactions you have.



More information about the seaside mailing list