Thursday, October 28, 2010

Review of: Flex On Java

Authors: Bernerd Allmon and Jeremy Anderson
Publisher: Manning Publications
ISBN-10: 1-933988-79-7
ISBN-13: 978-1-933988-79-5

$39.99 (Manning publishing) 266 pgs.

Reviewer: John S. Griffin

Adobe Flex has become a prolific toolkit for building RIAs. A primary advantage of Flex for RIA development is that it integrates easily with any back-end technology. By providing native XML, SOAP, and Data Remoting capabilities, Flex enables developers to build rich new UIs on top of existing services. For Java developers this combination is especially compelling because many Java systems have already embraced service-oriented architectures with SOAP Web Services, Spring, or one of numerous other technologies.

The book starts off by introducing the two technologies and building a sample Java application you can play with. After that you continue by building a Flex client for the Java application that ties into some Java web services. Part 1, introductory information, covers the first four chapters.

Part 2, chapters 5 and 6, introduces topics that allow Flex to connect to Java through object remoting, logging, and messaging. In chapters 5 and 6 a deeper dive is taken into backend integration with Java on the server side. Using the Spring Framework for Flex integration is demonstrated.

Part 3, chapters 7-11, covers a hodgepodge of topics, such as security and personalization, building graphs, desktop development with AIR, unit testing, and building a Flex and Grails application.

Maven is the build tool of choice for this book and its configuration is delved into as needed for the examples.

Summary of Contents
Part 1: Getting started
Chapter 1: Some Flex with your Java?
The book begins with a brief history of Java and Flex and continues with a rapid tour of Flex including how to start building a Flex application.

Chapter 2: Beginning with Java
This is a book about Java integration, but a simple Java web application is built. Frameworks were chosen that should ease the Java learning curve necessary to get a sample application up and running fast.

Chapter 3: Getting rich with Flex
A disconnected naked UI Flex client can take advantage of mock data and allow developers to easily prototype a UI without the complexity of external dependencies. This approach is demonstrated in chapter 3 where the beginnings of a rich UI for the FlexBugs sample application are created. This is the running application common to all Manning Publishing books.

Chapter 4: Connecting to web services
This chapter demonstrates connecting to the Java server side and how to leverage the Flex API for connecting to web services. Rather than use the typical approach of current literature, including the Flex online documentation, clean interfaces and views are created and a Flex client that will scale on demand is created.

Part 2: Strengthening the backend
Chapter 5: BlazeDS remoting and logging
This chapter demonstrates further how to connect a Flex client more directly to the server side using the open source BlazeDS framework. BlazeDS provides a mechanism for allowing Flex to call methods on Java objects through binary serialization with the Action Message Format or AMF. This chapter also covers BlazeDS logging in detail.

Chapter 6: Flex messaging
Here is a demonstration of how to develop Flex applications that take advantage of simple polling. We have to wait until chapter 11 for the discussion on how to connect using Java Message Service (JMS).

Part 3: Going above and beyond
Chapter 7: Securing and personalizing your application
This chapter demonstrates building authentication, authorization, and personalization with Spring Security (Acegi) integration.

Chapter 8: Charting with Degrafa
Degrafa is a declarative graphics framework that provides a suite of graphics classes. Degrafa is open source and can be used to build robust charts, tools, and other graph- ical elements with less effort and complexity than other frameworks. How to accomplish that is this chapter's topic.

Chapter 9: Desktop 2.0 with AIR
Comprehensive coverage of all aspects of converting a Flex application to an Air application including how to set up deployment is the topic of this chapter.

Chapter 10: Testing your Flex application
Every good programming book includes a discussion of unit testing. Some discuss Test Driven Design (TDD). This chapter discusses both of these topics.

Chapter 11: Flex on Grails
This chapter assumes that you are at least somewhat familiar with both Groovy and Grails, but if you have never seen or done any development using either, you should still be able to follow along. Idiomatic Groovy code is shown but not much detail about what the code does is given as that is apparently beyond the scope of this chapter. A simplified contact management application called Flex Contacts is built. Included are the details of exposing a Grails service to Flex and integrating Flex with JMS.

To begin with, readers of this book should be familiar with software development in general, specifically Flex and Java. Although the book was written to teach integration techniques for Flex and Java, not language fundamentals, it was done in a manner making it easy for even Flex or Java beginners to get rolling quickly with both.

This book is absolutely loaded with example code and every (that's right, every) configuration file change is delved into step-by-step.

Chapter 5 is the bomb! To paraphrase a fellow reviewer, this chapter alone is easily worth the price of the book! The simplifications presented here utilizing Spring will easily save both Java and Flex developers a ton of time in development. The how to of Java/Flex messaging implementation leaves chapter 6 not far behind.

More and more of the upper class of technical books are dedicating at least some time to discussion of application testing. Flex on Java takes this a little further with coverage of Test Driven Development (TDD). It contains a very welcome and much needed canvas of continuous integration with Hudson.

When this reviewer first examined this book, Chapter 11 seemed to be kind of a redheaded stepchild chapter until the realization that co-author Jeremy Anderson is quite involved in the Groovy scene. This chapter's strengths are two-fold. It demos Rapid Prototype Development (RPD) by taking leave of the running application and presenting a new pared down application. Secondly, it shows the implementation of JMS and ActiveMQ but since this is done in a Groovy environment it is of questionable value to Java/Flex developers. Groovy developers should appreciate it, however.

If you are a Java and/or a Flex developer that must interface between one and the other of these technologies then this book's plentiful examples and timesaving techniques are for you. You can't go wrong.

Monday, October 4, 2010

Here's another review. This one is of Manning Publication's Flex 4 in Action.

Review of: Flex 4 in Action

Author: Tariq Ahmed et al

Publisher: Manning Publications
ISBN-10: 1935182420
ISBN-13: 978-1935182429
Available: 28 Oct 2010

$33.74 ( 600 pgs.

Flex 4 in Action is a rewrite and update of the original Flex 3 in Action published in February of 2009. The book retains its overall topic flow so it will feel like an old warm blanket for those that learned Flex 3 from the previous edition or used it as a reference. New readers will feel just as welcome as it is an easy-to-read, thorough tutorial of what you need to know to come up to speed with the new Flex 4. There are also a couple of additions to the book that take it a step above the others.
The authors are acknowledged experts in their respective fields and have converted organizations to utilizing Flex for enterprise class applications.

Summary of Contents
Part One: Application Basics
Chapter One: Making the case
The book starts by talking about challenges that a web developer faces and how to solve them using Flex by Adobe. It also dives into the mechanics of a Flex application and discusses the Flex ecosystem as a whole.

Chapter Two: Getting Started
The authors show you how to take advantage of open source tools. They spend a good part of this chapter discussing Flash Builder and how to begin producing Flex applications.

Chapter Three: Working with ActionScript
Chapter 2 introduced ActionScript and this chapter is dedicated to it. The authors admit that entire books could be and are written about it. This chapter focuses on ActionScript?s core concepts of variable types, operators, loops, conditions, arrays and functions.

Chapter Four: Layout and Containers
In this chapter Flex?s visual building blocks and types of containers are discussed. These components can be anything from buttons, tables and graphics to other containers.

Chapter Five: Displaying forms and capturing user input
Creating forms in Flex is the topic here using input components (controls) and capturing user input.

Chapter Six: Validating user input
In this chapter how Flex handles validation and the different types of validators?such as those which verify the proper formatting of phone numbers and the structure of email addresses is covered. They are put to use, employing several different approaches.

Chapter Seven: Formatting Data
Formatting raw data with Flex?s built-in formatters is the subject of this chapter. This includes types of formatters, real-time formatting, scripted formatting and finally dealing with formatting errors.

Chapter Eight: MX DataGrids, lists, and trees
The authors cover everything you ever wanted to know about using list-based components from the MX library. Topics include list-based components displaying flat data, displaying hierarchical data, handling user interactions and retrieving selected items from List-based components.

Chapter Nine: Using the Spark List controls
In this chapter, you learn about the list-based features and functionality that ship with the Spark library, which is new to Flex 4. The discussion starts with the Spark list-based component architecture, and continues with how to leverage the new list-based Spark functionality in your Flex 4 applications.

Chapter Ten: List customization
This builds on chapter 9 by demonstrating how to customize the list-based components. Topics covered include the labelField property, label functions, overriding itemToLabel, item renderers and editors, advanced item renderers and filter functions.

Part Two: Application flow and structure
Chapter Eleven: Events
The event system is introduced along with its all-important role in a Flex application. Integrating native and custom events in an application while gaining an understanding of event nuances is also covered.

Chapter Twelve: Application Navigation
This chapter looks at the following components that you?ll use to add standard navigational features to your application: Menu, MenuBar, ViewStack, ButtonBar, TabNavigator and Accordion.

Chapter Thirteen: Introduction to pop-ups
The different ways of creating and managing pop-ups as well as simple ways to style them are here along with how to utilize the pop-up manager to help you create, delete, position, close, and destroy windows.

Chapter Fourteen: Implementing View States
This chapter starts by introducing the concept of view states in general. It then continues by covering everything you need to know about them.

Chapter Fifteen: Working with data services
This comprehensive chapter is all about data-centric development with Flash Builder. Starting with connecting to web services it continues with using the HTTPService and WebService components and understanding the Action Message Format (AMF). Communication with JavaEE using BlazeDS, ColdFusion Communication and communicating with PHP via Zend_AMF rounds out the discussion.

Chapter Sixteen: Objects and classes
Exploration of a fundamental feature of Flex, objects and classes, is the core of this chapter along with some OO theory. Covered topics include OO concepts, implementing OO concepts, using ActionScript classes, how to create, invoke and destroy them, and extend those that already exist.

Chapter Seventeen: Custom components
This chapter covers the basics of creating and utilizing custom components and tackles ways of getting your components to communicate with each other. Starting off by taking a look at how components are handled in Flex 4 and the Spark architecture, the discussion continues on with types of components and the difference between simple and composite objects.

Chapter Eighteen: Creating Reusable Components
Code reuse is the topic of this chapter. The example used in this chapter takes a look at a scenario where a component that reveals content must be created, but in many different ways, yet without having to write a separate component for each implementation.

Chapter Nineteen: Architectural Design Patterns
A deep look into Flex-driven design patterns and the thought process behind the core Flex architecture is taken. Then, rolling your own Flex application architecture is discussed without getting over-complicated. This chapter covers the Model-View-Controller pattern, how to roll your own architecture and mentions the frameworks Mate, Cairngorm, Parsley, and Swiz along with a deeper discourse into the Robotlegs framework.

Part Three: The Finishing Touches
Chapter Twenty: Customizing the Experience
This chapter focuses on the user experience and how you can leverage user experience design techniques in Flex to enhance your applications. The VIBE Model, themes and skins, CSS in Flex 4 and best practices are discussed.

Chapter Twenty-One: Working with Effects
This chapter first explains what effects are and how to use them and then the types of out-of-the-box effects are discussed.

Chapter Twenty-Two: Drag-and-Drop
D&D is considered from a usability point of view rather than just because you can use it or because of the coolness factor. The authors discuss how a mindset change is needed to accomplish this.

Chapter Twenty-Three: Exploring Flex-Charting Chapter
In this chapter, exploration of what makes up a chart, the charts that come with Flex, and how to customize them is covered.

Twenty-Four: Debugging and Testing
Debugging applications using the Flex debugger, using the Flash Builder Profiler and Unit and Functional testing of your applications is discussed.

Chapter Twenty-Five: Wrapping up a project
Tying up loose ends and getting the project out the door by customizing the HTML wrapper and deploying it to a production server is this chapter?s topic.

Chapter Twenty-Six: Working with XML
In this final chapter, Flex's robust XML support, from its ability to use XML as a source of data, to how you can use Flex to directly manipulate XML code is presented.

This new edition contains a thorough coverage of the new Spark components of Flex 4. It contains all you need to know to write applications with the new API.

The authors know from experience what you, as a developer, need to succeed and they make an admirable attempt at conveying it. This is nowhere more prevalent than their discussion in chapter 22 where they attempt to make you understand that just because something is 'cool' is not the reason to implement it in an application. When a feature will get the job done is the time to put it to use. You just need to change the way you look at things.

The book features two new chapters one of which was sorely missing from the previous edition. Chapter 19, Architectural Design Patterns, is a long overdue and very welcome addition. This chapter is a critically needed discussion of software architecture and assistive frameworks for Flex. Most books get atrociously overcomplicated, stay solely with theory and fail to bring those concepts to reality. They need to actually go through the process of designing architectures for actual enterprise applications. This chapter gives you the basics of how to go about it. This reviewer believes that a little two much time is spent with RobotLegs in this chapter at the expense of the others mentioned (one of the authors, Joel Hooks, plays a large part in the development and support of RobotLegs so that explains that). There aren?t even simple examples of the other second-generation frameworks Mate (pronounced ma-tay) and, this reviewer?s personal favorite, Swiz.

Chapter 9, Using the Spark List Controls, is the other new addition. This includes a thorough discussion of the Spark List Controls' class hierarchy and customization.

In chapter 24, Debugging, the authors could have spent a little more time on the Network Monitor and Profiler that comes with Flash Builder. There is a little more discussion of the Profiler but both of these topics are cursory at best. Also, this chapter provides sample code for unit testing Flex with the FlexUnit library. This is an absolutely essential addition.

Taken as a whole this new edition gives you good thorough coverage of the new Flex 4 and provides some sweet additions at the same time.

Those of you reading this who decided to pass on buying one of the other Flex 4 books before Flex 4 in Action made its appearance on shelves will be well served. It was worth the wait.