TSSJS DAY 2: Java and Flex

Sitting in on James Ward talk on Java and Flex. James shows a great Flex app for accident report.  Instead of prose, he shows it graphically.  This is his lead-in to RIA apps as a more compelling option to traditional Web app development.

Flex builder IDE is used to develop in two types of languages: ActionScript and MXML.  The former was JS-based but now is more OOP-based like Java.  The latter is more like XML to do declarative programmer to instantiate objects and set properties.  You don’t necessarily have to use the latter.  The resulting artifact of the code is a SWF file that runs on the Web server.  Alternatively, you can also deploy to the desktop runtime called AIR.

Flex can use a number of protocols to interact with the app server as SOAP, HTTP/S, AMF/S, and RTMP/S.  Use BlazeDS or TC services to access Java services.  AMF/S is extremely optimized!

Tour de Flex has over 400 samples that you can copy-n-paste code into your own projects.  Great samples for several types of controls, data access, AIR capabilities, etc. He showed a nice map tool that allows you to see who’s using Tour de Flex currently…pretty cool!

James showed an example of using simple HTTP data services into a data grid…seems pretty straightforward.  Next, we showed an example of calling a Web service…just change a few things to switch over.

Checking out his census site.  Pretty cool site to show where the long pole is when returning a large data set and demos of different transfer types, especially AMF to reduce time.

BlazeDS you add some libraries, map a MessageBroker in the web.xml, set up the broker in the services-config.xml and in remoting-config.xml you set up a destination to configure everything.  In the front-end you just use a “RemoteOject” and define the endpoint and destination.  He bumped up the results from 200 to 20000 and got sub-second response!!  Spring BlazeDS makes it even easier using an annotation driven approach to hook-up to the service or any Spring bean.  GraniteDS and GAS are some other projects to look at.

Another option is you can use streaming to set up pub/sub style for async processing.  This can certainly hook into a JMS Adapter.  For offline, you can use local shared objects (large binary cookie) to store data, but AIR has a sqllite database as a better offline option.

In summary, it looks like you can create some really visually compelling web sites with little coding compared to some other frameworks I used in the Java EE world.  It will be interesting to invest some more time with this especially consider the amount of data I need to move around to the GUI for our customers.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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