Skip to main content

Session Notes - Flex for Grails Developers

Presenter: Scott Davis

  • Flex plugin for Grails isn't a simple plugin like the YUI plugin
    • technologies are too different from one another to fully integrate
  • What's Flex?
    • free open source framework, but Flex Builder costs
    • lots of technologies floating around
      • some free of cost, some free and open source, some for pay
  • we are living in the era of the RIA
    • poorly defined
    • involves flex, air, silverlight, openlaszlo, ajax, java fx
      • java fx is applets redux--that's how they're deployed
        • some nice new stuff, but still 1995 technology with a new marketing plan
    • adobe has crushing lead in the ria space
    • lots of politics come into play--e.g. no flash player on iphone
      • apple converts all youtube content to quicktime to avoid having to use the flash player
  • have macromedia to thank for the ria term
    • idea was can't use same technology already in browser for rich experience
    • solution is plugins into the browser
  • plugins aren't new
    • applets introduced in 1995
    • lasting achievement of java applets is the warning asking whether or not you trust the applet
  • fast-forward to 2005
    • jesse james garret coins "AJAX" term
      • blog post discusses how web developers are envious of desktop developers
      • pointed to google suggest and google maps as examples
      • major thing is eliminating the page loads
      • amazing thing about google maps is they did it without a plugin
  • great divide (?)
    • can either have js + css + html, or can use a plugin
    • walls are starting to crumble however--hybrid development
    • apple desktop widgets
      • native part of OS but live in a different space
      • create in html, css, and js
      • use the webkit framework for rendering
      • gadgets in windows are similar
    • palm pre
      • webos
      • build apps with basic web languages
    • google chrome OS
      • OS based on chrome web browser
      • isn't a scrim on top of OS like widgets and gadgets
    • notion of pulling up a web browser to run webapps will soon be seen as rather quaint
    • Adobe AIR is one attempt to eliminate the browser from the equation
    • idea of ubiquitous web also well represented by iTunes
      • webkit browser baked in
    • future of software development -- of course it's web enabled
      • the idea of web/not web will fade into the woodwork
  • twitter example of how ecosystem can develop around an API and core data
    • twitter doesn't have to own the hardware and software

Nuts and Bolts of Flex

  • grails plugins assume you're conversant with the acronyms and technologies involved with Flex
  • flash player is where flex apps run
  • flash player revs about every year, and the new players get adopted very quickly--huge adoption rate
    • 80%+ of users are on the most recent version
    • many, many more people run old versions of java as compared to flash
  • flash player on most mobile platforms but not on iphone
  • adobe recently released tools to allow for compilation of flex apps into native iphone apps
  • flash offers similar "write once run anywhere" experience
    • java: class files run in JVM, JVM native to OS
    • flash: swf files run in Flash Player, Flash Player native to OS
    • javascript model is a bit different--still breaking differences between the browsers
      • javascript libraries get around the browser incompatibilities
      • javascript engines in the browser aren't pluggable/upgradable
  • ECMAScript -- standard with 3 major dialects: javascript, actionscript, jscript
  • js engines
    • firefox: spidermonkey
    • chrome: v8 engine
    • IE: JScript 5.8
    • flash/flex: actionscript engine
  • adobe collaborating with mozilla
    • donated actionscript virtual machine (AVM2) to the mozilla foundation
    • tamarin will be used for javascript 2
    • same javascript engine as used in flash player
    • javascript is traditionally interpreted
    • V8 and Tamarin do a lot of just-in-time compiling
    • probably be years before this is a standard
  • swf is a partially open file format
    • specs are published, but adobe retains ownership
    • everyone can read/write swf files, but spec isn't open for change
  • openlaszlo
    • because swf format is open, openlaszlo is written in lzx but generates a swf
  • flex is an sdk
    • big switch from the animation history of flash--flex is a 'business toolkit'
    • flash player is free but not open source
    • adobe dabbling with open source--tamarin, open source sdk
    • flex builder isn't even free as in beer
      • eclipse plugin
      • also plugin for intellij
  • here's what we know so far
    • jvm (jre) == flash player
    • class (JAR) == swf
    • jdk == flex sdk

Deeper Dive Into Flex

  • two key technologies: mxml and actionscript
  • mxml--tag-based like html
    • declarative, nested hierarchy of widgets
    • mxml is the html/css analog in this environment
  • actionscript
    • ecmascript dialect
      • if you know JS do you know AS? yes and no
    • first official version of AS was in Flash Player 5
    • huge maturation with AS 2, even more with AS 3
      • AS has been sliding more and more towards Java in terms of strong typing, inheritance, packages, etc.

Flex Development

  • need flex sdk
  • similar manual install process as with groovy and grails
    • set up flex home directory as an environment variable, add flex bin to path
    • mxmlc compiles mxml/AS code into swf
  • can buy Flash Builder, but isn't required for development
    • development experience isn't nearly as good without Flash Builder
  • IntelliJ has Flex capabilities as well (only in pro version)
  • Google provides SWCs to incorporate google maps into flex appss

Grails Plugins

  • four plugins
  • GraniteDS Flex Plugin--seems to be most mature and well documented
    • includes GraniteDS for data services
    • originally required JPA, not GORM
    • GORM support now in the plugin (experimental)
    • install the plugin, annotate the services and controllers
    • can then generate AS3 domain classes as well as the flex app itself

Comments

Popular posts from this blog

Installing and Configuring NextPVR as a Replacement for Windows Media Center

If you follow me on Google+ you'll know I had a recent rant about Windows Media Center, which after running fine for about a year suddenly decided as of January 29 it was done downloading the program guide and by extension was therefore done recording any TV shows.

I'll spare you more ranting and simply say that none of the suggestions I got (which I appreciate!) worked, and rather than spending more time figuring out why, I decided to try something different.

NextPVR is an awesome free (as in beer, not as in freedom unfortunately ...) PVR application for Windows that with a little bit of tweaking handily replaced Windows Media Center. It can even download guide data, which is apparently something WMC no longer feels like doing.

Background I wound up going down this road in a rather circuitous way. My initial goal for the weekend project was to get Raspbmc running on one of my Raspberry Pis. The latest version of XBMC has PVR functionality so I was anxious to try that out as a …

Running a Django Application on Windows Server 2012 with IIS

This is a first for me since under normal circumstances we run all our Django applications on Linux with Nginx, but we're in the process of developing an application for another department and due to the requirements around this project, we'll be handing the code off to them to deploy. They don't have any experience with Linux or web servers other than IIS, so I recently took up the challenge of figuring out how to run Django applications on Windows Server 2012 with IIS.

Based on the dated or complete lack of information around this I'm assuming it's not something that's very common in the wild, so I thought I'd share what I came up with in case others need to do this.


This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Assumptions and CaveatsThe operating system is Windows Server 2012 R2, 64-bit. If another variant of the operating system is being used, these instructions may not work properly.All of the soft…

Setting Up Django On a Raspberry Pi

This past weekend I finally got a chance to set up one of my two Raspberry Pis to use as a Django server so I thought I'd share the steps I went through both to save someone else attempting to do this some time as well as get any feedback in case there are different/better ways to do any of this.

I'm running this from my house (URL forthcoming once I get the real Django app finalized and put on the Raspberry Pi) using dyndns.org. I don't cover that aspect of things in this post but I'm happy to write that up as well if people are interested.

General Comments and Assumptions

Using latest Raspbian “wheezy” distro as of 1/19/2013 (http://www.raspberrypi.org/downloads)We’lll be using Nginx (http://nginx.org) as the web server/proxy and Gunicorn (http://gunicorn.org) as the WSGI serverI used http://www.apreche.net/complete-single-server-django-stack-tutorial/ heavily as I was creating this, so many thanks to the author of that tutorial. If you’re looking for more details on …