To AMF or not to AMF that is the JSON
by steve on Oct.06, 2009, under Programming
Ok I admit the title is corny.
All of the Flex applications that we have written in the past years have been using XML. I mean why not? It is simpler to use, easier to understand and teach to new developers, easy integration with our existing Grails apps via REST/webservice, and most importantly it’s open! What actually scares me is the nature of AMF being a native serialized object built and written for the Flash Player.
But why must this guy post his performance test between XML and AMF (http://www.jamesward.com/census/) and pulls me out of dreamland? Now I am having second thoughts of moving to AMF. Though I am not sure if there are even stable opensource java-amf projects (stable being > 1.x release). The building directory kiosks that we have right now are wirelessly connected to the data server which shares the same bandwidth with the streaming video from the ads server. Performance is a priority in the kiosk as users expect it to perform like a desktop application. Using XML does not only waste a lot of bandwidth, much work is shoved thru the machine to parse the XML file. That was the reason why much study was made whether or not Atom processors were good enough for the kiosks.
There are actually two ways to cross the dark side; out of the XML light. One would be Grails-BlazeDS via Flex plugin. The plugin pretty much does the configuration for you. Just don’t expect flex views! Another way would be to use JSON which has been hanging around with Grails core since < 1.x. This could be a better alternative as JSON is supported by most web programming languages. Though AMF performs better than JSON, as most tests suggest, but the difference is negligible. I guess the deciding factor here is maintenance and which language is easier for developers. I believe it is safe to say that more developers are familiar with JSON than AMF. Hiring devs with Flex-AMF-Java experience might be more difficult for our clients for post production support.
November 28th, 2009 on 3:44 am
You may want to look at vtd-xml as the state of the art in XML processing, consuming far less memory than DOM
vtd-xml