Pro Flex on Spring – Book Review


I just finished reading Pro Flex on Spring by Chris Giametta (APress).  Unfortunately, I can’t bring myself to recommend it.  I really wanted to, as I am getting more into Flex and I have been a Spring evangelist since before it was called Spring.  My primary concerns center around organization and approach to the example application.  I believe these things get in the way of presenting the core concepts.

The book starts off with the obligatory chapter on RIA and introduction to Flex and Spring.   This is likely necessary to provide a context.  Chris then proceeds to spend a chapter developing a lengthy project plan for the application to be developed throughout the book.  This includes project objectives, wireframes, etc.  I didn’t mind the chapter except that I was ready to launch into construction at this point.  Hold your horses.  First there is a chapter on exploring the various tools and means for developing Flex/Spring apps.  At the end of the chapter there is a rather awkward lesson on creating 3 different Eclipse projects to hold the client, server (Spring/Hibernate), and library projects.  They are rather oddly named but that is a personal preference.  Okay now we should be ready to start.

Not quite.  There are another 6 or 7 chapters to endure first, including another introduction to Flex applications (am I supposed to be adding these snippets/examples to the projects I just created?).  The Flex deep dive gets off on some tangents that I believe would be best left for later.  For example, diving into graphic manipulation (Matrix, Graphics, etc.) and skinning at this point is a little premature.  I would have focused on the basics, perhaps demonstrating the technique of custom components by overriding a behavior or creating a component that combines a couple of UI widgets.  So I am typing along, not knowing if this stuff is going to be used down the line or not, or where the heck I should be saving it.

Next is a chapter on Spring.  Again, nothing wrong with Chris’ description.  Unfortunately, he starts creating sample applications again.  I am typing away thinking this somehow all ties together and if I quit now, I’ll only have to come back later.  I don’t have any issues with his use of Spring in the examples, it’s just hard to cover the concepts in such limited space much less try to create a sample multi-tiered application within the same chapter.  Again, I would have stuck to explaining the concepts and left the detailed code for the sample application (which I presume we will get to at some point).

Moving right along, we dive into Flex and Spring Integration Architecture.  Now we are getting somewhere.  This is probably one of the more valuable chapters in the book although I probably could have done without another example (RSS feed reader).  Chris does a good job explaining the various means for interacting with the server side.  He also includes a nice description of the Spring BlazeDS integration project designed to help simplify the configuration.  

Chris then digs into Cairngorm and PureMVC, taking the opportunity to introduce yet another sample application – the Contact Manager.  Again, I love examples.  However, trying to introduce so many unrelated sample applications throughout the book draws attention away from the overall concepts.  There is too much space wasted describing code required to make each example work.  After all, once you dive into an example application you have to provide the complete code base or that will create other frustrations.

Chapter 8 is on Data Persistence and Chris feels obligated to describe (with examples) each technology that may be used to access data (iBatis, Spring JDBC, Hibernate, Hibernate with annotations, etc).  

Chapter 9 is on Security and this was pretty nice as it focused on Flex integration with Spring Security.  However, it did not mention the Spring BlazeDS Integration project and how it helps simplify the communication between Flex and Spring Security.  Also, I don’t believe he needed to get as detailed on the implementation of the authentication example.  There are simple pre-defined beans in the Spring Security library for facilitating authorization against an in-memory or persistent user directory.  Perhaps those would have been adequate enough to explain the concepts.

In Chapter 10 we finally get around to the sample application set up in Chapter 2.  The remaining chapters deal with building out various aspects of the example, including the database model, Spring Service tier, presentation, etc.  I would say that Chris’ strength appears to be in the presentation tier with Flex/ActionScript.  I’m not crazy about some of his design patterns/strategies on the server side.  In particular, I have to admit that I never quite embraced his “object identifier” concepts and use of an “assocobjectID” field on every entity table.  It seemed obtuse and non-descriptive.  I’ve never seen this used in practice.  I much prefer for green field projects to stay with conventions such as “id” or “xxxx_id” for the primary key and “xxxx_id” for the foreign key fields in many to one relationships.  Anyway, I am picking at straws here.

The bottom line is that I am happy to start seeing books on Flex as an enterprise application technology.  Unfortunately, this one makes it a little hard to get to the meat of the content.  If you are thirsting for any content on the subject, I would pick up a copy.  However, I would focus on reading through it rather than trying to work the examples.  You may get frustrated.

  1. No comments yet.
(will not be published)
*