5 advice for developing RIA and WEB application in Flex

important-128x128Compared with Flash development environment, the component library of flex is more attractive. But because of fully function, the size of program commonly will be very large, and to be very slow. The following is 5 advice about how to optimizate your application in Flex.

1.  Avoid embed containers inside other containers. Reducing use of relative size and relative position

When the element size in container is described by percent, any change of the size or postion will take the re-position for all subset in container. The calculation will be great if the level of embed is deep.

2. Using lightweight containers like Canvas As far as possible

Canvas is the smallest container and only support absolutely positioin. Most time it could instead HBOx and VBox. Besides, Canvas is a first choice for us when custom containers. It has basic container function and good expand ability.

3. Avoid using large components like DataGrid, AdvancedDataGrid
Large components have powerful function but need high requirement for memory and CPU. Because of the complexity, it is difficult to realize the skin, patterns and itemRenderer.

4. Using paging when deal with data

When using data type control, as far as possible to minimze the amount of showing data. For example Tilelist, it will create all the data whether need or not. It will waste large resoures. When ViewStack 、TabNavigator, etc. dealing with element, data will not be created until they’re shown first time. The unnecessary cost will be avoided.

5. setStyle and styleName

In fact,the skin of Flex components is a visual element. In process of components initialization, they will use current style(for example:styleName) to finish all the skin elements.If we reset the style, the size of components by setStyle, the postion will also be adjusted. Link to the first point, if components in a deep level embed container will cost large calculation.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter
RSS Enjoy this Post? Subscribe to Ntt.cc

RSS Feed   RSS Feed     Email Feed  Email Feed
You can leave a response, or trackback from your own site.

6 Responses to “5 advice for developing RIA and WEB application in Flex”

  1. 达达 says:

    Hi,I translated your article into Chinese.
    http://www.asflex.cn/?p=81
    Thanks~

  2. Ki-Han Shin says:

    This is good information. Can I scrap in my blog?

  3. Ntt.cc says:

    @Ki-Han Shin
    You are welcome, only need put a back link here. :)

Leave a Reply