Understanding Flex 2.0 Capabilities

Background

Flash

User interface designers and developers have been severely limited in their choice of tools for online applications since the Web’s inception. While backend developers could leverage the power of robust OO languages like Java and .NET, interface developers have struggled through the evolution of table-based designs in HTML to integration with JavaScript and Cascading Style Sheets into meaningful applications. A lack of consistent support between browsers and the absence of powerful languages with which to design interfaces has hindered development.

To address these issues, Macromedia leveraged their animation tool, Flash, as an Internet-deployable way to make interactive movies. As Flash developed, developers were granted more and more freedom to create applications similar to those available on the desktop. Additionally, as the Flash player spread to every browser and device available, developers no longer needed to spend the arduous hours traditionally required to address incompatibility issues in HTML, JavaScript and CSS.

Flash, however, has always been geared more toward graphic designers than application coders, who are often initially confused by concepts like the timeline or the Flash development environment. To address these issues, Macromedia invented a new way to develop Flash applications using programming languages and metaphors developers were used to: Flex.

Flex 1.0

In early 2004, Macromedia (now Adobe) released Flex 1.0 as a new way to develop Rich Internet Applications. The intention of Flex 1.0 was to leverage the already engaging Flash client with the immense power of Java server-side technology using powerful programming styles familiar to desktop application developers.

Flex 1.0 was released as a J2EE application that compiled Adobe’s proprietary MXML and ActionScript into Flash applications (.swf’s). Flex 1.0 applications deployed in a browser to any systems running Flash Player 7. Deploying to the Flash Player greatly increased cross-platform compatibility.

Version 1 Flex applications were required to run on a Java-based application server known as Flex Presentation Server. Flex Presentation Server acts as a gateway, allowing the client to communicate with XML Web Services, Remote Objects, and most other SOA’s. Although simple to install and configure, pricing started at around $12,000. The server also lacked certain management and analysis features common to competing server products.

MXML, an XML-based scripting language, was a huge step forward for developing on the Flash platform. MXML allows any developer with no prior Flash experience to develop Flex applications. However, due to the fact that MXML compiles down to ActionScript, both languages can be used for greater customization.

The components derived from the Flex 1.0 framework initiated the first steps toward positioning the Adobe Flex platform as a familiar and efficient way to produce immersive presentation tiers.

Flex 1.5

Macromedia promptly responded to most Flex 1.0 shortcomings by releasing Flex 1.5 in late 2004. Four main features were added in Flex 1.5, positioning Flex even closer to the top of the RIA food chain. The important new features included: improved data display and visualization tools, enhanced performance, more versatile styling and skinning, and even more deployment platforms.

In Version 1.5, Adobe also released Flex Charting Components, which provide simple interfaces for displaying data in a number of different charting formats such as pie graphs, bar and column charts, and line graphs. Flex Charting also provides a set of transitions that you can apply to animate the graph as data changes.

for more info on Flex 1.5, visit: http://www.adobe.com/macromedia/proom/pr/2004/flex_15_announce.html

Flex 2.0

In mid-2006, Adobe drastically improved existing Flex technology with the release of Version 2.0. Version 2.0 was significant for two reasons. First, Adobe removed the original licensing and compiling restrictions on Flex and released Version 2.0 as Open Source. A command-line Flex compiler was provided free of charge, along with source code for the thousands of rich components present in Flex since its inception.

Next, Adobe updated Flex and MXML to integrate with the new and powerful ActionScript 3 programming languages. ActionScript 3 has many advantages over ActionScript 2, including strong typing and a more consistent use of object-oriented programming metaphors familiar to all application programmers today. A full discussion of the merits of ActionScript 3 is beyond the scope of this document, but with the use of this language and access to the full set of Adobe component library source code, developers were given an even greater degree of freedom in developing components for Rich Internet Applications.

Development in Flex 2.0

You can develop Flex 2.0 applications using one of two basic approaches. First, you can develop them in any preferred text editor and compile them using the free command-line compiler provided by Adobe. This approach gives you the freedom to work with whatever environment and programming tools you’re used to without incurring any cost for the use of the environment.

Second, you can license the Flex Builder Development IDE from Adobe for a marginal fee. Flex Builder is built on the Open Source Eclipse environment, which is familiar to many application developers as both a standalone IDE and a plugin for Eclipse. Flex Builder also makes a Design view tool available: it provides a WYSIWYG (What You See Is What You Get) interface to create MXML files, which is useful in managing the basic elements of Flex application layouts.

Architecture

Flex uses of a number of programming metaphors familiar to application developers, but aren’t available or easily accessible in other RIA programming environments. Let’s take a look at some of them.

Event-Driven Components

Flex uses the event broadcaster/listener paradigm to communicate between objects. ActionScript 3 makes these concepts available in a way that developers used to the pattern will instantly recognize, particularly those used to implementing it in Java. Other RIA development schemes rely on more clumsy methods of passing data between objects.

Data Binding

Flex introduces a concept of data binding to communicate between objects. Data binding allows a developer to effectively bind a data field on one object to a field or fields on other object(s) through a few lines of code. Flex implements this by compiling data binding into a combination of an event dispatcher, listener, getter, and setter behind the scenes. This gives you cleaner code and instant access to updated data, allowing you to focus on the real problem the RIA is designed to solve, rather than managing excessive but necessary code.

Accessibility

Adobe’s component libraries promote accessibility by providing a framework that easily supports a wide range of accessibility tools, including screen readers and a variety of input devices, from mouseless workstations to webcams.

Automated Testing

FlexUnit is a free set of application libraries that allows automated testing of Flex applications, much like JUnit for Java.

Flex Data Services

According to Adobe’s web site, Flex Data Services is a J2EE application that provides high-performance connectivity with existing server-side data and business logic. Flex Data Services allows for seamless access server-side objects in Flex, and integrates seamlessly with other powerful middleware, such as Hibernate and Enterprise Java Beans.

Flex Data Services has several advantages over traditional web services, including data synchronization and serialization. Flex Data Services implements a unique form of data synchronization that allows for instant updates and doesn’t rely on polling, making your application’s view of your data a simple extension of the database. Flex Data Service’s use of serialization makes it easy for developers to manipulate data in the client-side Flex application in the same way they’d manipulate it in Java on the server-side, without worrying about data being lost or corrupted between client and server.

Flex Data Services also offers a wide range of pricing options, from a free single-CPU production version to volume licensing. Adobe’s offer of a free version ensures that developers can create and test their applications locally without purchasing a license for yet another piece of software.

Flash Media Server

Flex integrates seamlessly with Flash Media Server, an Adobe product which manages streaming media content. Integration with Flash Media Server ensures that application developers can focus their efforts on making interfaces to video media rather than consuming a lot of time by managing the video content themselves.

Player

The Flash Player has several features that make it attractive as the deployment environment for Rich Internet Applications. Let’s discuss a few of them.

Vector-Based

The Flash Player renders objects as vector-based images, meaning that each line and curve is drawn dynamically. This ensures that images don’t lose their crispness as the scale changes.

A good example of where this is useful is when displaying a map. In a traditional RIA, the map is displayed in some sort of graphical format such as a JPEG, GlF or PNG. If someone wants to zoom in on a certain section of the map, another raster image featuring a more detailed view of the area (appropriately scaled for that person’s screen) needs to be served to the user, causing a noticeable lag in the application.

In direct contrast, the Flash Player simply redraws the image with the appropriate scale and dynamically adds features as necessary, so that all processing is performed quickly on the client side. This ensures that the application responds as quickly and effectively as a traditional desktop application.

JIT Compiler

Inconsistent and poor performance is often noted as a major problem in the traditional web browser. Flex offers greatly improved performance by running in the Flash Player, which uses a Just In Time (JIT) compiler. Applications are delivered to the player’s virtual machine as byte code and then compiled just before execution on the client’s machine. This allows for increased performance times and is a tried-and-true method of delivering content and is used by all Java and .NET applications.

Performance is an important aspect to consider when creating great Rich Internet Applications. A JIT compiler ensures that Flex applications respond to user interaction with the same speed and robustness of a traditional desktop application.

Bitmap Manipulation

Flex provides an extensive bitmap manipulation library that lets developers create applications that dynamically generate and alter bitmap-based images.

Video

The Flash Player provides a built-in video-viewing component, which ensures people have a consistent experience viewing video. Developers don’t need to worry about serving multiple versions of the video to accommodate different players and operating systems; they can embed the video directly into their applications in meaningful ways that enhance user experiences. Due to these advantages, many of the videocentric sites that have emerged in the past several years (such as YouTube), deploy videos using only the Flash Player.

Transitions and Effects

Flex makes the robust transitions and effects that Flash applications are known for easily accessible to developers without bogging them down in timeline details. Flex provides a complete library of simple effects that developers can leverage to create meaningful transitions that enhance the feel of applications. Transitions include complex movement effects, fade effects, sizing effects, and rotation effects.

Since Flash was first developed, effects on web pages have been controversial. Everyone who’s used a web site can probably recall visiting sites where a poor implementation of effects lead to a confusing interface. At the same time, when used correctly, effects can greatly enhance user experiences and make applications easier and more interesting to use. Simple, elegant effects and animations have been implemented in desktop applications with great success for at least a decade now, and designers of Rich Internet Applications should aspire to offer the same degree of comfort to their users.

Flex also supports a wide range of sound effects. These are easily implemented through an extensive sound object API.

Printing

Flex applications can easily use the browser’s inherent printing capabilities so that people aren’t limited to viewing data onscreen, but can print relevant documents and data. Flex developers can also restrict which portions of the application can be printed to help ensure copyright laws on things such as images (like a Flex image gallery for a photographer’s web site).

Binary Sockets

The request/response model used by traditional web pages leads to slower, unresponsive web pages. Flex uses binary sockets to enable real-time bidirectional transfer of data between client and server. The Flex Messaging Service uses this functionality to provide a complete messaging solution that integrates with existing enterprise solutions such as Java Message Service (JMS).

Localization

Flex allows limited access to read and write data on a client’s local machine. Flex applications are limited to reading only local shared objects they’ve saved, preventing security holes inherent to other localization schemes. Flex applications can leverage data localization to increase performance times and give a measure of offline support to applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.157.142