Well the 2/3 review of the book I’m currently writing, Flex on Java, has just been wrapped up and we’ve gotten some wonderful feedback from our reviewers, both good and not so good. I’m learning that the not so good reviews are sometimes more useful in helping us to refine and improve the book in the long run. More than one reviewer had commented, and I had started to believe this myself before the review even began, was that the sample application that we had decided to use was too cumbersome and involved too many workarounds to make it work.
My co-author (BJ Allmon) and I had originally intended to leverage an existing application that we would refactor to use a Rich Client interface so that the experience would more closely resemble the audience we were originally targeting; the Java developer who would be tasked to integrate Flex with their existing application. So after much thought and some suggestions from some co-workers, we decided on XPlanner would be a good candidate. XPlanner was a project that hadn’t seen any real development in a couple of years, it’s infrastructure was not chosen with Flex in mind, and it was a sample application that we really wanted to make work.
Unfortunately the more we tried to make XPlanner work with Flex, the more we realized this was a bad idea. The SOAP implementation had to be tweaked because for some reason when doing inheritance with Axis the ordering of the elements in the SOAP response are out of order, which screws up Flex’s parsing resulting in some elements being returned as null when unmarshalling the objects in ActionScript (http://bugs.adobe.com/jira/secure/attachment/17509/Flex3Bug.txt). That was fixed fairly painlessly but once we got to the point where we were attempting to integrate with BlazeDS we quickly learned that most of the functionality we needed to populate the screen was not exposed as a service, but rather many of the CRUD operations were implemented in JSP custom tags, so we were forced to have the reader implement those in order to follow along. It was becoming apparant that this wasn’t going to work out.
After much reflection over the holidays, I had come to a solution. We would remove XPlanner from the book as a sample application, even though I was dreading the thought of having to build up a sample Java based web application from scratch so late in the game. I was longing for some sort of framework that would help me get a web application up and running, and quickly, kind of like Grails but for Java and not Groovy.
Then the answer came to me, AppFuse. For those of you not familiar with AppFuse, it’s basically a skeleton Java web project that provides many services for you out of the box. You then plug in all of your application specific code and build on top of AppFuse to create your application. This was the answer I needed. This also allowed us to now address one of the other comments that we received from our review; our book had assumed some high level of Java and Java web application knowledge effectively alienating the Flex developer who wanted to break into Java web development on the back-end. It also allowed us to not stray too far from our original goal of an existing application for the basis of a sample application. Even though we’ll now be building up the Java portion of the sample application in our book instead of using an existing one, by leveraging AppFuse we’re following many best practices for Java web development that make no assumptions about the view technology being leveraged, and developers with existing applications they want to refactor should easily be able to adapt anything in the book to their specific environment.
I must admit that I’m getting very excited about this new direction, I had rediscovered AppFuse which had played a role in me learning Spring and Struts, and helped me to refine my views on what good Java web application architecture consisted of. Even though we’ll now have to refactor half of our book to accomodate this new sample application, I’m confident that it will not only improve the quality and clarity of the book, but it will also open up the book to a whole new audience that we weren’t targeting before.




As a longtime AppFuse 1 and 2 user, I think you could have better luck going with something more geared towards Flex only instead of all the web frameworks available, like the blazeds-spring maven archetype from project FNA (http://code.google.com/p/fna/) where I did some contributions
I did consider using FNA and do admire the goal of what Adobe is trying to accomplish with FNA, but decided to go with AppFuse instead for several reasons. First and foremost was the that FNA didn’t pass my 15 minute rule for a framework, which means that if I can get it working within 15 minutes of trying it, it’s very likely that my readers won’t either and will be frustrated. FNA is a fairly new project and while I was able to eventually get it to work I doubt many of my readers will want to put forth the same effort I did to make a sample application work.
AppFuse on the other hand is a very mature and stable product with a much larger community backing it. So even if the reader does encounter an issue while trying to follow along in the book, they are much more likely to get timely support from the AppFuse community. AppFuse is also a fairly well known framework in the Java community, which is my primary audience for this book. Chances are good that anyone currently using AppFuse, or even those who aren’t, should be able to take and adapt the knowledge gained from the book and apply it to their own specific environment.
Jeremy,
I think it is a good move for you to use AppFuse. However, I saw that you are using BlazeDS. I know that its compelling to use BlazeDS since is is Adobe’s offering but you should consider some of its main competitors such as GraniteDS or WebOrb. One thing that is still an issue with these apps is Hibernate lazy loading. GraniteDS has that problem solved, I am not sure about WebOrb and hibernate but WebOrb has a lot of codegen build it to build an activerecord data access layer from an existing database. And both BlazeDS and GraniteDs will create your actionscript classes from your pojo’s.
Personally I use WebOrb because I am working in a .net company right now and they offer a .net, java, php, and ruby platform.
Just food for thought, i know that the hibernate issue is a dead end for a lot of projects, then they have to go to webservices or REST (which isn’t too bad in most cases).
Hello, i hope i don’t disturb the discussion, but i read that CMH was a weborb user, so i have a little question for him…
CMH, can you tell me how to access a mysql db from weborb, using a java server and flex? because no samples are working…
There is a discussion on Matt Raible’s blog about using graniteDS, weborb instead of blaze DS – check it out http://raibledesigns.com/rd/entry/weborb_have_you_ever_heard