« Return to Thread: Menu component - communicating with root component

RE: Re: Menu component - communicating with root component

by Sebastian Sastre-2 :: Rate this Message:

Reply to Author | View in Thread

>
> 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.

Cheers,

Sebastian


_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

 « Return to Thread: Menu component - communicating with root component