Pro Flex on Spring


Title: Pro Flex on Spring
Author(s): Chris Giametta.
ISBN: 1430218355
Published: Mar 2009
Relevance: 5/5
Readability: 5/5
Overall: 5/5

More Apress Books Reviews …

This book was an excellent choice to let me go deeper and get better knowledge about Flex with Spring.This book has detailed theory and a lot of source code in action, many patterns was applied throughout the book, well done.

This book is an excellent material about integrations among many frameworks and something important is the patterns applied. Furthermore even when this book is released on 2009, is not out of date about how make the integrations, this is something important to be considered.

The TOC is the follow:

  • Chapter 01: Rich Internet Applications with Flex and Spring
  • Chapter 02: Project Planning for Flex and Spring
  • Chapter 03: The Tools for the Job
  • Chapter 04: Introduction to Flex Applications
  • Chapter 05: Introduction to Spring
  • Chapter 06: Flex and Spring Integration Architecture
  • Chapter 07: Architecting the View: Cairngorm and PureMVC
  • Chapter 08: Data Persistence
  • Chapter 09: Security
  • Chapter 10: Flex, Spring, Cairngorm, Hibernate: Bringing It All Together
  • Chapter 11: Building the Database
  • Chapter 12: Building the Spring Services
  • Chapter 13: Building the Flex User Interface
  • Chapter 14: Porting the Flex Application to AIR

Lets go with my review:

Chapter 01: Rich Internet Applications with Flex and Spring

Based about a RIA introduction, valuable explanation including some interesting advantages like it is 10 time faster than HTML and is stateful. Two important images are available, the first based of n-tier architecture and the second based on the RIA architecture, therefore you see clearly where RIA fit in a n-tier architecture. The most valuable is the concrete explanation about each tier.

After this, an interesting and well explained introduction about Adobe Flex is available, and its benefits too.

Introduction to the Flex and Spring frameworks is available too, more expanded is for Spring, including an image about the Spring‘s modules and explanation for each one of them

To finish this chapter, covering about Flex and Spring working or related together is covered shortly.

Chapter 02: Project Planning for Flex and Spring

Interesting chapter, practically starting with the technologies to be used for a project called AF-Client Manager, These ones are:

  • MySQL
  • Adobe Flex SDK
  • Cairgorm
  • Spring
  • Apache Tomcat
  • Alive PDF

Other two interesting list are available too, for design and management.

The AF-Client Manager is explained through four sections

  1. Define a high-level list of business requirements
  2. Define the core features for the application
  3. Build the project plan
  4. Create the project wireframes for user interface development

Covered with long theory, the two last points are the most important, the third offer concrete but valuable explanation about the follow phases of a project, these ones are: Define, Design, Produce, Testing and Implementation. The fourth is the most impressive because many pages of GUI design to be implemented by Flex later are available. Complex GUI designs, very hard to implement if you think use only HTML.

A Database schema image is available too, more of ten tables exists. To finish the chapter a valuable image about Spring service layer with DAO access is included. You get a better and clear idea about the roles of an DAO and BO(Service) objects.

Chapter 03: The Tools for the Job

Starting quickly with a list of the tools to be used, these ones are:

  • Apache Ant
  • Eclipse
  • Version control system (Subversion or CVS)
  • Spring IDE (if you don’t want to use the Eclipse Java perspective)
  • Adobe Flex Builder
  • Flex SDK

The ant tool is covered with a build script to compile flex code, mxml, the rest is covered quickly with short theory and some images

The important material is about how set up the Project Directory Structure. How create a Flex Project with Eclipse IDE is covered with images and its respective explanation, a valuable table about the Flex Project Directories is available, there, explanation for each item is well explained, same appreciation about the use of important images applied for Flex Library and Spring.

To end the chapter working with CVS is covered using images again.

Chapter 04: Introduction to Flex Applications

This chapter start quickly with valuable code about MXML and ActionScript, covering quickly about containers, tags and Namespaces. Then How Handle Data in Flex is shown next, explaining the four different approaches available, these ones are:

  • Curly braces ({})
  • The tag in MXML
  • ActionScript expressions
  • ActionScript bindings

Each one explained with theory and source code with its respective explanation, I like this way to learn

The next section covered is about validation, three different approaches are available, again the previous way to teach is used, well done.

  • Triggering validation through ActionScript
  • Triggering validation through data bindings
  • Triggering validation through events

Formatting Data is covered with concrete theory and source code. Until here for all the previous differents approaches taught, for each one an image of the final view result is shown too. Therefore you know what expect

Even more, the author teaches us how we can create our own components with ActionScript, well done, covered through many pages with step instructions and source code and a respective image of the result. Valuable theory to learn. The same approach is used about Adding Styles with CSS well done!. A quickly variation of this, is about Skinning.

To finish the chapter how use Flex Libraries is taught through some images and a snippet code to do a reference to some library.

Chapter 05: Introduction to Spring

It is an interesting chapter because give you a quickly and well explained material to get a good overview about what Spring does for you and how work. It start quickly explaing about Inversion of Control (IoC) and Dependency Injection (DI) in a concrete way with simple source code to learn easily both topics.

Next Spring MVC is introduced, the MVC components are explained, Model, Controller and View. Therefore next a detailed sample code covering the integration of Spring MVC with Flex is available. Well done the xml configuration code for this, for example for web.xml and springMVC-servlet.xml, the rest of the code cover about the Model and some Controllers used for this sample application, same appreciation for the Service. To cover Flex a .mxml file content source code is shown, not complex. Finally a final image of the application is shown

Among other sections the author cover how do Testing with Spring, even doing reference to TDD, source code with its respective explanation is available

Chapter 06: Flex and Spring Integration Architecture

An impressive and excellent chapter, a lot of source code gentleman!.

It start with the section Transport Architecture based on concrete theory and an image showing a Standard three-tier architecture for Flex and Spring

The follow section is really well covered, well done, expanded theory and valuable source code to explain The Three Flex Communication Protocols, even including for each protocol an image to show us how work, again well done, therefore these protocols covered are:

  • HTTPService Protocol
  • WebService Protocol
  • RemoteObject Protocol

The next section is Flex in the Enterprise based in concrete theory but including an very important image about How Flex fits in the enterprise architecture, really is a valuable image.

Now we follow with Using Flex RPC RemoteObject, the author teaches us about how configure the Web Server, here he share some tips about configuring some Java options (-Xms -Xmx and others), we turn to How Install BlazeDS, based in steps intructions and a good amount of Java and Flex MXML source code. Therefore How Integrate Flex and Spring with SpringFactory is taught through detailed steps instructions. Valuable source code included

Something interesting and to finish the chapter is the other approach to do this integration, the author teaches us this working with Spring BlazeDS Integration, based again, through valuable and detailed steps instructions.

Chapter 07: Architecting the View: Cairngorm and PureMVC

It is a long an excellent chapter, again a lot of source code is available

The author start covering Using PureMVC where a very important image showing the PureMVC object model is available, you can see really how these components are working together, even more, explanation of each component is available. Really I like this.

Now come a lot of source code within the section PureMVC Framework Implementation for Flex, based on step instructions with many ActionScript source code and a final image to see the output result. Practically 18 pages covering this, enough?.

Now the other topic to be covered is Cairgorm, like the previous section, we have a very important image showing the Cairgorm object model, where you can see really how these components are working together, even more, explanation of each component is available, even more, other image about Cairgorm MVC relationship is available too.

Therefore to finish the chapter, the sub section Cairgorm Framework Implementation for Flex is available, based on step instructions with many ActionScript source code and a final image to see the output result. Practically 16 pages covering this.

A lot of pages and source code to understand, same approach to teach each approach was used, well done!

Chapter 08: Data Persistence

Another well written chapter, well done, starting quickly with the section Spring Database Transaction Management where the explanation of each component of the ACID term is available. After this, the author show us many Transactions Managers Configuration mandatory for some persitence options supported by Spring

  • JDBC
  • ibatis
  • Hibernate

Furthermore How make the Transactions Configurations is explained in its all different approaches:

  • Programmatic
  • XML
  • Annotations

Each one of them with its respective source code

The follow section is very interesting, is about Setting Up for Data Persistence working with a simple SQL table definition and its Java object representation. including the DAO and Service interfaces with its implementations and a .properties file implementation.

With the all previous configuration the author cover the follow mechanism of persistence

  • JDBC
  • ibatis
  • Hibernate

Really well covered each technology, you can see clearly for each DAO how each respective template is used. Therefore you can realize yourself the features and advantages of each persistence mechanism, same appreciation about complexity for each one about configuration and implementation

BTW, for the two last options, ibatis and Hibernate, are working with BlazeDS, because we have the Service objects working with @Transactional and of course some extra xml configuration to do this integration was need.

Chapter 09: Security

Starting quickly with concrete theory about Flash Player Security doing an interesting analysis about the security applyed on a local vs Network Access. Then covering about Cross-Domain Access is available with valuable theory and configuration.

Then the next section is Flex Security, based on many inner sections or sub topics covered with valuable theory to be consider. Something like hide the source code, security data in SWF files, validation input etc. Source code and result output is available too.

To finish the chapter a section dedicated about Flex with Spring Security is available based on source code, configuration and result output, again BlazeDS is used. This section is dedicated for integration purposes. The example used is a Login Form created with Flex

Chapter 10: Flex, Spring, Cairngorm, Hibernate: Bringing It All Together

Did you recall the AF-Client Manager project?. OK, here we have expanded this situation, an image about the object model is available, each one later is explained through a table which contains its properties with a brief description, six pages containing these tables.

With all this now come some configuration, instructions to create this project with Eclipse IDE is available, besides of some .SWF files
need it as cairgorm and af_lib (custom library created on other chapter) are mentioned, futhermore two pages about what the jar files are need it, is included too, it is based for each framework referenced. Since the project is not handle with Maven, an image showing the application structure is available.

Spring Configuration for Flex is available, therefore web.xml and other xml file about security to work with Flex are covered, same appreciation about Hibernate Configuration for Spring and for Cairgorm Configuration for Flex, many pages of MXML and ActionScript are available

Therefore this chapter is based only in setting configuration. Not complex

Chapter 11: Building the Database

Starting with important theory about Design, Teminology and even Design Tips about how to work with a Database.

Then MySQL enter in action, explanation about types of tables is introduced, and same appreciation about the Data Types

Then for the application AF-Client Manager its database schema is introduced through with an image. Some sql command examples on terminal/console and even how use MySQL Administrator tool is shown through images, with these two options and to finish the chapter, four pages showing the sql statements to create each database table is available.

Chapter 12: Building the Spring Services

Really an impressive long chapter, 90% based on source code, therefore you have here what exactly you need, code to understand and the reason of the things.

The chapter start with an important image about the AF-Client Manager system architecture, then now come the huge amount of source code starting with:

  • Domain object including the JPA entity annotation support
  • Interface and implementation service objects
  • Interface and implementation DAO objects working with Hibernate (including @Transactional support)
  • XML beans configuration to integrate all these components.

Wondered why the Service objects are not @Transactional too, it is the weak part of this chapter in my opinion

Chapter 13: Building the Flex User Interface

Other impressive long chapter, dedicated to create the GUI views based with Flex.

Again, the chapter start with an important image about the AF-Client Manager component model, where you can see all the view object components used for this application, this image is shown in one page, all the components are related in a tree hierarchy. Even another image about how all these .mxml files are distributed within the application directory structure is available.

The rest of the chapter is implement each view even including ActionScript within these .mxml files, Cairgorm is used again for the Flex RemoteObject configuration, furthermore events and commands are covered with ActionScript.

To finish the chapter Skinning and Styling is used and how final result some result GUI are shown in images

Chapter 14: Porting the Flex Application to AIR

Interesting chapter, covering concepts about AIR, quickly the author provide us an ant build script to build AIR applications, almost three pages about this. Flex SDK is used to create AIR applications too.

With all this the author include a simple sample code about a Login Form written on a .mxml, then the code is compiled and tested like an AIR application, even more how create an AIR installation file is taught too, all this was done with commands (amxmlc, adl and adt)

The next section is about Creating an AIR Project with Flex Builder, covered with concrete theory and images to show some steps instructions.

A key chapter is about how Moving your Flex Code to AIR explaing with a simple source code and later with Flex Builder and with images representing the steps instructions the author teach you how do this transformation, even how include a Digital Certificate

What I liked:

  • Valuable and a huge amount of source code!
  • Even if each framework covered in the book has not been explained in deeper detail, the book gives you a good overview for each framework and the most important, is useful to learn how to make these integrations among them.
  • Patterns and many options about MVC working for Flex was used
  • You can read the entire book comfortably
  • Easy to understand a 99% the source code throughout the book
  • What I disliked:

    The missing use about @Transactional in some chapter for the business objects


    This is my second time about I regret made my decision about request this book some time late, because the book use Flex 3, but I consider not very critical or negative about this work.

    Therefore this book is not obsolete if you think in patterns and make integrations.


    More Apress Books Reviews …

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s