Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A component in FlexJS consists of strands onto which beads are added. A strand is the component wrapper or framework while a bead encapsulates a particular bit of functionality. In the example above, the password and prompt features are beads that can be added to a text input component's strand. Further, the actual text input control is provided by a view bead and the data (the text itself) is managed by a model bead. In this way, components in FlexJS embody the model-view-controller (MVC) paradigm.

...

Beads can interact with each either through the strand, with events, or direct manipulation. For example, a bead that makes text red might listen for changes to the component's text input view bead model and, when it detects a key word, changes the text directlyin the model; the change to the model would get reflected in the view bead. Beads can add visual elements to components (view beads) or just change data or handle events.

...

You want to make things as efficient as possible in both environments. For instance, the TextInput component in ActionScript is comprised of view and model beads. The JavaScript TextInput has neither since HTML has a view and model already (via the DOMHTMLElement); the FlexJS TextInput component is just a thin wrapper for the HTML control. When you begin creating your JavaScript component, take the time to understand the best way to represent it so the component is as optimal as possible.

As components become more complex, such as with the Slider component, more of the ActionScript style code is present in the JavaScript component.

...