Adobe Dreamweaver Forums



Last 10 THreads :         problems linking PDFs (Last Post : Alan - Replies : 3 - Views : 4 )           »          Flash movie not working in html (Last Post : WEBDavid - Replies : 0 - Views : 1 )           »          load xml into mc symbols (Last Post : DigitalUprising - Replies : 0 - Views : 1 )           »          drop down menu over flash (Last Post : ltartisel - Replies : 2 - Views : 3 )           »          Flash-PHP Mail Form (Last Post : kglad - Replies : 3 - Views : 4 )           »          Flash Controls Not Displaying in Embedded File (Last Post : kglad - Replies : 5 - Views : 6 )           »          DW Flash Encoder (Last Post : wycn - Replies : 2 - Views : 3 )           »          navigation bar (Last Post : G. Rex - Replies : 5 - Views : 6 )           »          Adobe Flash 10 kills Wimpy (Last Post : ClubEXL.com - Replies : 82 - Views : 955 )           »          static sound (Last Post : 21n9 - Replies : 10 - Views : 11 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-25-2008, 04:44 AM
peteandrus
 
Posts: n/a
Diggs:
Default Best way to lay this out?

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 want
to notify a bunch of different components. Some of these have the same parent
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?
thanks!



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-25-2008, 04:53 AM
*gsb*
 
Posts: n/a
Diggs:
Default Re: Best way to lay this out?

Lood at the 'event aggregator design pattern' perhaps.
Here is a google search key to try:
+flex +"design pattern" +"event aggregator"

HTH

Reply With Quote
  #3 (permalink)  
Old 11-25-2008, 05:14 AM
peteandrus
 
Posts: n/a
Diggs:
Default Re: Best way to lay this out?

Greg,
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

Reply With Quote


  #4 (permalink)  
Old 11-25-2008, 03:14 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Best way to lay this out?


"peteandrus" <webforumsuser@macromedia.com> wrote in message
news:ggfvkj$sje$1@forums.macromedia.com...
>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
> want
> to notify a bunch of different components. Some of these have the same
> parent
> 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?
> thanks!


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.

HTH;

Amy


Reply With Quote
  #5 (permalink)  
Old 11-25-2008, 04:24 PM
rtalton
 
Posts: n/a
Diggs:
Default Re: Best way to lay this out?

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.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 12:42 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk