onttpi 发表于 2008-4-20 23:08

Top 10 Mistakes when building Flex Applications

原文链接:
http://www.infoq.com/news/2008/04/top-10-flex-mistakes         
infoq 是在一个较偶然的机会看到。。。个人觉得新闻比较有用
PS:有中文版的infoQ


Posted by      Jon Rose      on      Apr 17, 2008 01:06 AM   
      
                        In this post, Adobe’s James Ward teams up with InfoQ.com to bring you another Flex Top 10 (our most recent Flex Top 10).Flex is an open source application development framework for buildingrich Internet applications that run in the web with Flash Player, or onthe desktop with Adobe AIR. Overall, Flex is a powerful framework thatis easy to use, but today let's focus on some of the common mistakesthat are made when building Flex applications.

For those new to Flex, check out InfoQ’s recent Adobe Flex Basics to get a quick introduction to the framework.Here is the list:[*]Using an RIA framework to build Web 1.0 applications (aka. New technology same old stuff).
One of the largest challenges when moving from Web 1.0 applications tothe RIA's development paradigm is learning to think differently. Flexgives developers an advanced component library that allows for doingthings that simply weren’t possible only a few years ago. Often, thepower of Flex is missed, and the framework is used to implement moretraditional Web 1.0 applications.

Building Web 2.0applications is more than partial page refresh and rounded corners. Forexample, Flex developers should be using vectors to provide users avisual understanding of data, and advanced controls for a richapplication flow. Stephan Janssen discusses this struggle recently with InfoQ.com:As a Java developer, learning Object Oriented ActionScript and the UImarkup language is really a walk in the park. The challenge however for(Java) developers is that we're not designers, and with RIAtechnologies these two skills are very much needed. [*]Breaking standard browser experiences.
While Flex does provide an excellent platform for improving the userexperience, it still important to maintain familiarity of things likethe back button, book marking, and auto complete.

Flex 3 includes new Deep Linking features for back button support and book marketing.You can learn more at labs.adobe.com.There are number of components out there for implementing auto-complete.From the Adobe Exchange, you can use the AutoComplete Input component.[*]Slowing the application down with the use of too many containers.
Flash Player uses a hieratical display object graph, similar to theHTML Document Object Model (DOM). The deeper containers are nested thelonger the rendering takes. Adobe’s Flex Developer Center has anarticle that covers best practices related to Flex performance,including the use of containers in detail: The biggestFlex performance danger is yielding to the temptation to use containersrandomly. Deeply nesting too many containers hinders the performance ofyour application. This is the number one performance danger that Flexdevelopers succumb to—and luckily it is 100 percent avoidable. [*]Slowing the application down by using XML for data transfer over optimized protocols.
Flex offers developers a number of options for data transfer betweenthe Flex client application and the server, including AMF3, XML, SOAP,and straight HTTP requests. Ward demonstrates the use of thesetechnologies and performance benchmarks in his Census application.

BlazeDS should be considered for Greenfield projects using Java on the backend.BlazeDS is Adobe’s recently open sourced Data Services productthat uses the AMF3 protocol. AMF is a binary transfer protocol that iseasy to integrate with Java, and offer significant performance benefitsover XML. There are open source implementations of AMF for every majorbackend technology.

If BlazeDS is not an option, Hessian could be an option.Hessian offers ActionScript/Flex support for their binary web services protocol.[*]Trying to hire Flex developers.
Experienced Flex developers are very hard to find right now. Flex is atthe point in the adoption curve which Java was at in the late nineties.The demand for Flex developers is exceeding the supply. This makesfinding experienced Flex developers difficult. This, however, creates ahuge opportunity for Java developers to expand their skill sets andwork with a fun emerging technology. Many companies looking for Flexdevelopers have great success training Java or other web applicationdevelopers for only a few weeks on Flex. Flex’s language and APIs areeasily learnable by developers who are familiar with Web and GUIprogramming.[*]Over use of animations
Using Flash as the runtime enables developers to easily add animationsand effects. However, developers should make sure that the animationshave meaning and provide context. Otherwise, they will annoy users. Thetiming of animations is also important. Interaction designers can helpmake recommendations on when animations should and should not be used.Interaction designers can also recommend the best type of animations,the duration, and the best easing function.

There is good a post on the use of animations at laair.org:Most animations are simply TOO LONG. They are long, and slow, andboring, and excessive. Tone it down. If there is one thing I havefound, its that I hate waiting for stupid animations to finish so I cando something else.

Don’t get me wrong I am not bashinganimations. I am simply bashing animations that are simply too long ortoo extravagant for their purpose. Every animation can be broken downto having a purpose. Figure out the purpose of your animation and applyaccordingly. [*]Not setting up an enterprise ecosystem.
As with other software projects, it is important to setup an enterprise ecosystem for your Flex applications.   

Test Driven Development (TDD) is a staple of most any enterprise project in this day-and-age.For Flex, the FlexUnit framework is available for coding unit tests.On Adobe’s Developer Connection, Neil Webb discusses TDD for Flex developers and using FlexUnit.In addition, Flexcover is available for code coverage reporting.   

Continuous Integration (CI)is a proven practice for building cohesive applications when multipledevelopers are contributing. Similar to Java applications, both Ant andMaven plug-ins are available for CI builds of your Flex applications.[*]Not using the entire framework.
There are a number of optional features available in Adobe Flex thatyou should consider using in your applications. For example, Runtime Shared Libraries (RSL) is available for reducing the size of your applications:    You can shrink the size of your application's resulting SWF file byexternalizing shared assets into standalone files that you canseparately download and cache on the client. Multiple Flex applicationscan load these shared assets at runtime, but each client need only todownload them once. These shared files are called Runtime SharedLibraries. Another under used feature of the frameworkis the built in accessibility features. You can read more about theaccessibility features of Flex in Adobe’s livedocs.In addition to built in accessibility, the framework provides built in features for localization.For the latest Flex 3 framework features, checkout Adobe’s Getting Started introduction page.[*]Slowing the DataGrid down with complex renderers.
The out-of-the-box itemRenderer for the DataGrid is very optimized.Mistake #3 discussed the performance impacts of deeply nestedcontainers. One of the places in Flex where containers can easily getdeeply nested is in the DataGrid’s item renderers. The number of itemrenderers which are rendered by the DataGrid is the number of visiblerows times the number of visible columns. Custom DataGrid and List itemrenderers should be very optimized. When complex layout logic is neededin an item renderer, it is best to use UIComponent (or other morelow-level classes) and position the contents for that cell manually.[*]Not Preparing for Offline Applications.
The traditional model for RIAs is in the browser.However technologies like Adobe AIR and Google Gearsis allowing those applications to run offline. By not preparing for apotential offline architecture when users demand it, changing yourapplications to support offline features may be very difficult.Typically, in web applications business logic lives on the server. Inoffline RIAs, business logic must transition to the client. This makesit nessecary to architect ahead of time where certain business logicwill need to live in order for applications to work both offline andonline.
页: [1]
查看完整版本: Top 10 Mistakes when building Flex Applications