T
T E Schmitz
Hello,
I would like to achieve the following:
Scenario:
Component A notifies component B about an event e1. B knows that there
are are various other components interested to know about this event. Is
it possible for B to relay this event to components C,D,+E? Or do C,D+E
have to be registered as listeners with A in the first place?
Also, another type of event e2 will cause the same action in C,D+E.
A doesn't [need to] know about C,D+E.
C,D+E don't care whether e1 or e2 trigger of the action.
Example:
Tabbed pane: When a tab comes to the front the data need to be refreshed
from the datastore. The panel associated with the tab contains several
"sub-panels", which are implemented as separate classes. They don't care
what the source of the event was. All they need is a trigger to refresh
themselves.
Only solution I can think of:
B provides A with a list of listeners collected from C,D+E.
Maybe I am just overlooking the blindingly obvious.
I would like to achieve the following:
Scenario:
Component A notifies component B about an event e1. B knows that there
are are various other components interested to know about this event. Is
it possible for B to relay this event to components C,D,+E? Or do C,D+E
have to be registered as listeners with A in the first place?
Also, another type of event e2 will cause the same action in C,D+E.
A doesn't [need to] know about C,D+E.
C,D+E don't care whether e1 or e2 trigger of the action.
Example:
Tabbed pane: When a tab comes to the front the data need to be refreshed
from the datastore. The panel associated with the tab contains several
"sub-panels", which are implemented as separate classes. They don't care
what the source of the event was. All they need is a trigger to refresh
themselves.
Only solution I can think of:
B provides A with a list of listeners collected from C,D+E.
Maybe I am just overlooking the blindingly obvious.