In this discussion, I will focus on the basics of Flex, a web development framework based on Flash. The first section will be about the whys and wherefores of Flex. The second section will cover the steps involving the development of a Flex-based application. In the third and fourth sections, a real world application using Flex will be developed.
Flex – the whys and wherefores
By definition, the Flex framework is “A collection of technologies released by Adobe Systems for the development and deployment of cross platform, rich Internet applications based on the Adobe Flash platform.” The Flex framework is also known as Flex SDK. The keywords in the definition are "cross platform," "rich Internet applications," and "collection of technologies." Let us look at these in detail.
Cross platform: Flex is based on Flash. Therefore, Flex applications will work on all those platforms for which Flash players are available. At present, Flash players are available for Mac, Linux and Windows. Hence, Flex applications will work on all of them.
Rich Internet applications: By definition, “Rich Internet applications (RIA) are web applications that have the features and functionality of traditional desktop applications.” In other words, RIA provides a paradigm that breaks away from the request-response-page refresh cycle. In RIA, only the request-response cycle exists. All the UI-based processing is shifted onto the client side. This paradigm is also known as the no-refresh paradigm. Since Flex makes use of Flash extensively, developing RIA using Flex scales down the problems associated with RIA.
The definition provides the attributes of Flex. However, it does not tell us what its components and services are. Therefore, let's have a look at the most common components and services of Flex. The components as well as services provided by Flex can be divided into the following categories:
Web and Utility services
The web and utility services provide web service and data access functionalities. Here are the details:
UI Components: This category contains components that can be used to implement the user interface of web applications. This category can be further divided into containers and controls. The former provide layouts and can contain the latter. Controls include textboxes, combo boxes, etc. All of the controls can be controlled using Action Script.
Charting Components: The charting components of Flex extend the Flex framework to provide charting functionalities, including line, bar, and pie charts. One can add drill down, roll over, and other visual effects so that data can be represented visually and dynamically.
Web and Utility Services: Using Flex, one can access Web services and display the data retrieved from the Web service. Apart from this, Flex also provides APIs to implement drag and drop, animation, effects, form validation, and application state management. These utilities are built into the core of Flex. Hence, to use them, one need not learn any third party APIs.
That brings us to the end of this section. In the next section we will discuss the steps necessary to develop an application in Flex.