0 Replies Latest reply on Jan 5, 2007 3:21 PM by Xin Yang

    Question on object state management

    Xin Yang
      I am seeking some generic advice on managing the states of many object instances more effectively.

      For example, I have some UI widget that contains couple sliders, I need to manage the "states" of those sliders and the most wanted "state" is the current value of each slider.

      Since a slider is just one way to provide a "value" state, the UI widget can replace any slider movieclip with some other "value" provider, say a meter-like movieclip and set the meter to the same value of the slider. In other words, I need to make sure the slider class, the meter class and any other "value" provider class can share some common states so that the UI widget can retrieve the states from one object instance and apply them to another object instance when movieclips (and the control class) are swapped in and out. This is basically something like states management for UI theming or skinning.

      So I make some Java Bean-like classes to store the states for the UI components, but as I get more UI widgets and UI widgets can nest or composite into new UI widgets, I end up with many state beans, and even I try to reuse and extend existing beans, I can still see quite some overheads among those bean classes.

      Does anyone have experience on similar matters and have a better solution?