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

Sebastian Sastre ssastre at seaswork.com
Mon Apr 21 18:46:46 UTC 2008

> so, to set-up a wiring you need to have visible both instances of
> driver and semaphore in some code to wire them up, which is not always
> simple because they can be placed using complex hierarchy like:
> street
>  |    |
>  |   car -- driver
>  |
>  crossroads -- semaphore
> >  Sebastian
> >
> >
Well said Igor! And which place for that wiring to happen is better than the one with a bird's eye? That's why parents wire children's events.

An almost literal example:

Parents have the responsibility to know how to react in front of the event of a children complaining about having fever. Children just have to complain.

So.. as you say, if the hierarchy is kind of deep you make a convenience to invoke "from the deeps" the wireable subchildren. That coupling is inevitable and reasonable. What is not reasonable is to aspire to make one object to react to an event (a explicit detailed interest) and at the same time pretend it should not know its origin (the wired sub/children). 

In such case different events should be triggered at different levels of the chain. To illustrate: the tire sensor event of a cool car saying "minimum pressure level reached", the wired computer reacting with turining on the alarm "problem in the tires of the car" (another event with different level of detail), wired by the driver who ... and so on


Sebastian Sastre

More information about the seaside mailing list