Review of: Flex On Java
Authors: Bernerd Allmon and Jeremy Anderson
Publisher: Manning Publications
$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.