Hey everyone,

Let me set up a situation for you.  Let's say you have an application 
with a component called Widget1 that's buried deep within the display 
list.  Widget1 displays 50 knobs.  Now, let's say you move to another 
part of the application and click a button that instantiates Widget3 
which shows certain pieces of information about the knob selected on 
Widget1.  Within the display list tree, Widget1 and Widget3 are far from 
each other and nested deep within other views.

In my experience, developers will usually create a property on the 
application's model (ModelLocator in the case of Cairngorm) that's 
called something like currentKnob.  That way when Widget3 is 
instantiated it can know which widget was previously selected in Widget1.

What are the best practices you've seen regarding this type of 
interaction within your applications?  One alternative I can think of is 
if Widget1 dispatches an event off Application that the *creator* of 
Widget3 is watching for.  Then when the creator of Widget3 actually 
creates the Widget3 instance, it can hand off the selected knob to the 
instance.  Thanks!

Aaron

Reply via email to