My experience on my daily works... helping others ease each other

Friday, July 25, 2008

5 advice for developing RIA and WEB 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.

Taken from ntt
Share:

About Me

Somewhere, Selangor, Malaysia
An IT by profession, a beginner in photography

Blog Archive

Blogger templates