This content has been marked as final. Show 4 replies
Lood at the 'event aggregator design pattern' perhaps.
Here is a google search key to try:
+flex +"design pattern" +"event aggregator"
thanks for the response. i tried that google search, but only got back pages with C# stuff in them. Is there a specific class that sets this up, or is this strictly a design consideration? i assume the latter, but want to know if there's any hope for the former! thanks, peter
"peteandrus" <email@example.com> wrote in message
>I have a component that will hold a Tree. In that tree are certain types of
> Objects, called 'JReport' objects. Whenever a JReport Object is clicked, i
> to notify a bunch of different components. Some of these have the same
> as the Tree, but most do not.
> What is the best way to design this? I want it to be as 'black-box' as
> possible, so no passing objects around if i can help it. Any suggestions?
The Observer pattern is a good one for this. Luckily, Flex's binding
architecture already implements this pattern. Create a model object that
you change a property of based on what object has been clicked, then bind
all the views to that property.
You might also consider dispatching a custom event when the object is clicked. Listeners could then be added to each component which needs to be notified, and the listener would handle all the components' responses.