About the Reviewer
Tim has spent more time toying with technology over the last twenty years than most folks will in a lifetime. He has been on the Interweb from beginning and was online back when 300 baud modems roamed the Earth.
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.

Programming Flex 2



Author(s) Chafic Kazoun & Joey Lott
Publisher O'REILLY / Adobe Developer Library
PubDate 2007-APRIL 1st ed.
Reviewer Tim Colson
Purchase and help Javalobby



Table of Contents




One Minute Review

Positives

  • explains many advanced compilation, framework, and component topics
  • could be a reference for specific advanced problems
  • provides detailed background of Flex component lifecycle

Negatives

  • intended for advanced reader, but often written for inexperienced reader
  • inexperienced reader may be confused by advanced subjects
  • examples are independent, i.e. not part of a complete application
  • redundant and verbose text can be boring
  • explanations often lack rationale

Sections

Intent & Audience

The authors say in the "Who is This Book for" section the intended audience is "anyone looking to learn more about Flex 2". They note that this is a "diverse group" and attempt to cater to everyone. The next paragraph contradicts that by explaining that in order to "get the most form this book", it is best that the reader understand OO, runtime environments, byte code, compilers, ActionScript, Java, C, C#, or another language.

Based on that, I was expecting an advanced book, with some detours to help out the novice. Instead, I felt the book constantly jumped between the two audiences. At times throwing advanced material like compiler flags in chapter two at the novice, and subjecting the advanced reader to rudimentary topics like a painfully detailed definition of XML and a basic primer on objects.

back to top Back to top

Relevance of material

The material covers many aspects of Flex development, but in this reviewers opinion, the book tells the story in bits and pieces that are generally not tied together into a cohesive story.

I had experimented with Flex 1.5 prior to reading this book, so I was expecting to see a deeper explanation of how Flex enables remote data retrieval over HTTP via XML or SOAP. I was frustrated that this topic was not covered until nearly the end of the book in chapter sixteen. Even then, the powerful ability to communicate with a server-side service was given minimal attention.

Topic selection and depth of coverage are challenging for any author, and relevance varies from reader to reader. Other readers may appreciate the areas that received greater focus (visual appearance, CSS, compiler flags, effect/transition animations, etc), but I was generally disappointed by the choice of material.

back to top Back to top

Chapter highlights

Foreward - by Mark Anders, Sr. Scientist at Adobe
I often skip this section, but as a reviewer I read the book cover to cover. That is fortunate, because Mark writes a truly engaging historical perspective on Flex development as well as an introduction the book authors.

Chapter 1 - Introducing Flex
Introducing any new technology is an obligatory component of a book. The authors do a good job explaining the different aspects of Flex as a platform for developing and deploying robust internet-based applications. And even for someone versed in Flex, I feel the chapter helped explain the Flex Framework in more detail than is covered in most introductions.

Chapter 2 - Building Applications with the Flex Framework
The chapter walks through the steps to use free Flex SDK, commercial Flex Builder, and Ant + the SDK to compile and run Flex applications.

The reader is confronted with pages of advanced compiler options that many developers may never even need, before even compiling a simple application.

There are roughly seven pages on creating "runtime shared libraries", prefaced with a warning that it is an advanced topic that the reader might want to skip. Pay attention to the warning! Skip the section because it will be confusing and useless until you have created fairly complex applications or need to embed third party component libraries.

Chapter 3 - MXML
By this chapter, I'm getting the feeling that the author(s) decision to write a book aimed at a "diverse audience" was a bad idea.

After a chapter devoted to obscure compilation flags and configuration settings, the book explains the rudimentary concept of XML markup as if the reader has never before seen XML nor created a web-application. But, within a few paragraphs, advanced topics like namespaces, components, layout containers, event handling, and data binding are being introduced, still before even a simple working HelloWorld application has been created.

If I was new to the platform, by now I imagine I'd be frustrated, unimpressed, and ready to give up on Flex. I'm also becoming annoyed with the repetitive style of the text that can be tedious. Entire paragraphs could easily reduced to a single line.

Chapter 4 - ActionScript

This chapter attempts to give an introduction to the ECMAScript programming language, ActionScript 3.0 which is the "glue" for Flex applications. As you can imagine, it would take more than 30 pages to do this fully, and this is noted.

However, the authors then attempt to explain not just ActionScript, but programming in general! They define "variables", "methods", "packages", "classes", and even what an "if" statement does. Obviously we're being treated as a novice, but then concepts like the lack of "overloading" and the inclusion of "rest" parameters, and object reflection are introduced – surely these would confuse the novice.

This wandering takes precious book space, which perhaps explains why interesting features of ActionScript 3.0, like E4X filters, were only briefly presented.

Chapter 5 - Framework Fundamentals

This chapter dives deep, realy deep, into the Flex Application Framework, including how the SWF file and Preloader interact to load and initialize application components. This topic is clearly advanced and these ten pages seem thrown in and out of place.

Chapter 6 - Managing Layout

At this point, I realize that the HelloWorld app has been assumed to be a snippet of MXML that creates a button. This chapter goes into detail with several snippets of code and screenshots to place many buttons in several layouts.

Chapter 7 - Working with UI Components

Although the topic of UI components logically follows the containers presented in Chapter 6, the book presents the various built-in UI components without placing them into a layout container.

A brief component dictionary is included, and various concepts are introduced (ex. Data Models, Collections, event handling, and data providers. The examples are still using static data, no mention of retrieving the data from a remote service yet.

Chapter 8 - Framework Utilities and Advanced Component Concepts

This chapter dives into tool tips, animation effects, pop-up windows and alerts, cursor management, Drag & Drop, customizing List-Based Controls through custom render functions, cursor focus, and keyboard management.

This is a lot to cover in 38 pages!

Most of the information is fairly advanced and is covered in reasonable depth, although there seems to be several copies of code that fill up the pages, and at times are duplicates except for small additions. The D&D examples use static data, which may be easier to explain. In a real application the data will most likely be dynamically retrieved from the server, so the reader may find difficulty in applying the D&D techniques.

Chapter 9 - Working with Media

The method for loading and embedding assets (eg. images, fonts, audio, video) is presented with fairly good details. In addition there is a really good explanation of "Scale-9" for enlarging images without distorting the scale of edge details. A simple video playback example is also included.

Chapter 10 - Managing State

Note to all traditional web-application developers, "state" deals with the "view" being presented, not "HTTP State". Creation and presentation of different "view states" is explained using both MXML and ActionScript. Object creation policies are mentioned in order to explain how to preload objects that may be used by a currently non-visible state.

Chapter 11 - Using Effects and Transitions
Visual effects for transitioning from one state to another are covered in 25 pages of detail. Unfortunately, the transition example is contrived and does not build on an existing "State" example from the previous chapter.

Chapter 12 - Working with Data

This chapter only deals with static client data and discusses how to store the data in Model or XML data structure components and hints at how these will be used to send and receive data in Chapter 16.

In addition, the concept of "databinding" is introduced in a rather large example. Oddly, the example leverages a web service before data services have been presented.

Chapter 13 - Validating and Formatting Data
Explains how to use built-in validators for user input, create custom validators, and format data for display, again using the built-in and custom formatters.

Chapter 14 - Customizing Application Appearance

Dives into how standard CSS is used to define application styles. Explains how to embed fonts into the application so that components can rotate text properly. Digs into "skinning" compoments with completely new graphical elements, how to modify the "preloader" to display a custom loading screen, and lastly how to compile all of these into a "theme" that can be user-selected.

Chapter 15 - Client Data Communication
Think this is about remote data? Think again, this chapter explains "local" client data communication. This includes communication between separate SWF (i.e. Flash(tm) components), "shared objects" which are similar to large "cookies" on the client machine, and ExternalInterface for hooking into the application that hosts the FlashPlayer (ex. call JavaScript in the browser).

Chapter 16 - Remote Data Communication

Finally! This chapter deals with HTTP requests for data from the back-end, mentions the ability to use sockets (but does not go into any detail or give any examples), and briefly shows how to upload/download files like a more traditional web-application.

Using a couple lines of MXML to connect to a stream of data on a server using XML of HTTP, or a formal SOAP web service, is an extremely powerful aspect of Adobe Flex.

As mentioned earlier, I was disappointed that this topic was only allocated roughly 20 pages, this far along in the book.

Chapter 17 - Application Debugging

Standard introduction to debugging, including the usual steps of setting breakpoints, stepping into code, watching variables, etc. FDB is the command line debugger; however, most of the examples are shown using the graphical debugger in FlexBuilder. Also briefly mentioned is the standard Logging Framework, logging targets, and how to connect for remote debugging.

Chapter 18 - Application Components
Shows one way to separate a large application into discrete components. A simple contact manager application is the basis for explaining the creation of a contact detail component. It is regrettable that we are exposed to this example application for the first time in the penultimate chapter, since it could have been carried through many of the prior chapters to tie concepts together. We do gain a fairly complete picture of creating the custom component, but details of using it are left out. For example, events for parent/child communication are introduced, but the custom EventHandler class and communication back to the "main" app is not fully explained.

Chapter 19 - Building Custom Components

The topic here is in some ways a continuation of Chapter 18, but with an deeper explanation of the Flex component lifecycle so that "commercial-grade" components may be developed. We are given a walk-through of steps to write a custom component, digging deeper still into the granular steps in the component lifecycle. It is a complicated process, and the authors do an admirable job trying to explain it; although in the end, they note that this is only the "basics" and that a "whole book" could be written to master the subject.

And with that – the book abruptly ends, i.e. no summary.

back to top Back to top

Rating

Relevance
Readability
Overall

back to top Back to top

Resources

Purchase this book on Amazon and help Javalobby.