What can Grails do for me?
                          An intro to Grails for Flex and Java
                                      developers
                           Flex on Java Exchange, London, June, 2010

                                   Tomas Lin ( @tomaslin )



Wednesday, 16 June 2010
Life is too short for
                                   XML


Wednesday, 16 June 2010
Agenda
                   • Who is this guy?
                   • 4 Cool Things About Grails.
                   • Building a Grails app.
                   • Flex and Grails - grails flex scaffold demo.
                   • Flex and Grails - blazeds4 plugin demo
                   • Questions?
Wednesday, 16 June 2010
Who is this guy?
           • Don’t worry, I’m not trying to sell you anything.
           • Currently a senior developer at DMC digital
           • Java / UI Developer since 2000.
           • Worked with Grails and Flex for about 2.5 years.
           • Canadian citizen born in Taiwan, raised in
                   Guatemala and working in the UK.



Wednesday, 16 June 2010
Blue
                          Ember
                          Grills

                          Flex 3 &
                           Grails




Wednesday, 16 June 2010
Suzuki Canada   Flex 3 & Grails
Wednesday, 16 June 2010
Dan Aykroyd Wines HTML, CSS, Flex 3, Grails

Wednesday, 16 June 2010
Empora.com Content Management System Adobe AIR
Wednesday, 16 June 2010
Grails
                   • An open source web framework inspired
                          by Rails and Django.
                   • http://www.grails.org
                   • Supported by VMWare / SpringSource



Wednesday, 16 June 2010
Grails
                          • Sky.com
                          • Walmart
                          • Wired
                          • LinkedIn
                          • Businessweek.in
                          • Suzuki.ca
                          • Tacobell.ca
                          • Deutsche Bank
Wednesday, 16 June 2010
4 cool things about
                                 Grails



Wednesday, 16 June 2010
Cool Thing #1: Ready to Go
                              Spring Framework
                            Hibernate ( GORM )
                                Quartz ( jobs )
                             Sitemesh ( layouts )
                          Spring MVC ( webflow )
                          Prototype / Scriptaculous
                                     Ant
                                      Ivy
                                  HSQLDB
                                   Tomcat


Wednesday, 16 June 2010
Cool Thing #2 : Groovy
                   • Java’s best friend
                   • Dynamic JVM language with full support for
                          Java objects and libraries.
                   • Compiles to Java Bytecode.
                   • Closures, builders, dynamic typing, etc...
                   • More relaxed, script-like syntax
                   • Features of Smalltalk, Python, Ruby

Wednesday, 16 June 2010
Text
                                   Text




                          Java . But also Groovy .
                                              original author of this slide is Marcel Overdijk -
Wednesday, 16 June 2010
• Dynamic types using the def keyword
                          • Optional return types
                          • Everything is public by default
                          • Optional semicolons, parentheses
                          • Variable interpolation via GStrings
                          • Automatic setters and getters
                                                    original author of this slide is Marcel Overdijk -
Wednesday, 16 June 2010
Healthy ecosystem
             • gPars - parallel processing
             • Groovy++ - static typing
             • Spock - data / behaviour driven testing and
                    specifications framework
             • Gaelyk - lightweight web framework for the
                    Google App Engine
             • Tellurium - automatic UI based testing
                    framework based on Selenium.
             • Griffon - Swing / Desktop applications.
Wednesday, 16 June 2010
Cool Thing #3 : 426 Plugins




Wednesday, 16 June 2010
Cool Thing #4: Flex +
                            Flash Integration
                                     BlazeDS
                                   GraniteDS
                               Grails Flex Scaffold
                                  Openlaszlo
                              JW FLV Media Library
                                       sIFR
                                      Red5
                                      Video
Wednesday, 16 June 2010
Building a
                          Grails application
                            ( woohoo! )


Wednesday, 16 June 2010
Wednesday, 16 June 2010
Wednesday, 16 June 2010
Wednesday, 16 June 2010
Grails Flex Scaffold
                     • Developed by Cubika in Argentina
                     • Flex 3, Cairngorm, Stark Security


                          @eapfel


Wednesday, 16 June 2010
Wednesday, 16 June 2010
BlazeDS plugin
                   • Developed by Sébastien Arbogast
                   • BlazeDS, Spring-Flex Integration
                   • Spring Security


                     @ sarbogast

Wednesday, 16 June 2010
Wednesday, 16 June 2010
Web Services
                          • Sometimes we can’t use BlazeDS / AMF
                          • REST - built in content negotiation
                          • SOAP / WSDL - via plugins like XFire, CXF
                            or Spring WS




Wednesday, 16 June 2010
Wednesday, 16 June 2010
Notes
                   • The Java introspector in Flash Builder 4
                          does not work with Groovy classes, but
                          you can use the DTO plugin to
                          automatically generate Java DTOs and cast
                          between Java / Groovy.
                   • There are a few plugins that aid with
                          Hibernate LazyInitialization issues. Gorm
                          Labs, for example, dehydrates Hibernate
                          sessions before being sent across the wire.
                   • IDE Support is actually quite good. My
                          IntelliJ trial expired yesterday. STS and
                          Netbeans also do Grails.
Wednesday, 16 June 2010
Other uses.
        • Tag libraries for embedding SWFs, providing
               alternative content for SEO.
        • Adding server side search via Lucene or Solr.
        • Deployment platform for Amazon / App Engine.
        • A nice proxy to bypass Flash Security restrictions.
        • Backend glue to PHP / Clojure.
        • Data import / massaging.
Wednesday, 16 June 2010
Wednesday, 16 June 2010
Flex / Grails Wish List
                  • Flash Builder extension for Grails
                  • UI Testing automation
                  • Integration with Model Driven
                          Development / LiveCycle services.
                  • A clear way to deal with Hibernate sessions.
                  • A way to template frameworks like Parsley,
                          Robotlegs or PureMVC
                  • Better integration with messaging options.
Wednesday, 16 June 2010
Why do I like Grails?
                   • Allows me to build backends to my Flex
                          applications quickly and effectively.
                   • Integrates well with existing Java libraries.
                   • Lets me try new things fairly risk free.
                   • Encourages modular development / re-use.
                   • Constantly getting better.
                   • Makes writing web applications fun.
Wednesday, 16 June 2010
Learn More!




Wednesday, 16 June 2010
                          grails.org/books
Learn More!
                    • http://www.grails.org
                    • Come to the user group meetings.
                     • Third Monday every month. Here.
                    • Grails mailing list.
                    • twitter: @tomaslin
                    • email: tomaslin@gmail.com
Wednesday, 16 June 2010
Questions?




Wednesday, 16 June 2010

Tomas Grails

  • 1.
    What can Grailsdo for me? An intro to Grails for Flex and Java developers Flex on Java Exchange, London, June, 2010 Tomas Lin ( @tomaslin ) Wednesday, 16 June 2010
  • 2.
    Life is tooshort for XML Wednesday, 16 June 2010
  • 3.
    Agenda • Who is this guy? • 4 Cool Things About Grails. • Building a Grails app. • Flex and Grails - grails flex scaffold demo. • Flex and Grails - blazeds4 plugin demo • Questions? Wednesday, 16 June 2010
  • 4.
    Who is thisguy? • Don’t worry, I’m not trying to sell you anything. • Currently a senior developer at DMC digital • Java / UI Developer since 2000. • Worked with Grails and Flex for about 2.5 years. • Canadian citizen born in Taiwan, raised in Guatemala and working in the UK. Wednesday, 16 June 2010
  • 5.
    Blue Ember Grills Flex 3 & Grails Wednesday, 16 June 2010
  • 6.
    Suzuki Canada Flex 3 & Grails Wednesday, 16 June 2010
  • 7.
    Dan Aykroyd WinesHTML, CSS, Flex 3, Grails Wednesday, 16 June 2010
  • 8.
    Empora.com Content ManagementSystem Adobe AIR Wednesday, 16 June 2010
  • 9.
    Grails • An open source web framework inspired by Rails and Django. • http://www.grails.org • Supported by VMWare / SpringSource Wednesday, 16 June 2010
  • 10.
    Grails • Sky.com • Walmart • Wired • LinkedIn • Businessweek.in • Suzuki.ca • Tacobell.ca • Deutsche Bank Wednesday, 16 June 2010
  • 11.
    4 cool thingsabout Grails Wednesday, 16 June 2010
  • 12.
    Cool Thing #1:Ready to Go Spring Framework Hibernate ( GORM ) Quartz ( jobs ) Sitemesh ( layouts ) Spring MVC ( webflow ) Prototype / Scriptaculous Ant Ivy HSQLDB Tomcat Wednesday, 16 June 2010
  • 13.
    Cool Thing #2: Groovy • Java’s best friend • Dynamic JVM language with full support for Java objects and libraries. • Compiles to Java Bytecode. • Closures, builders, dynamic typing, etc... • More relaxed, script-like syntax • Features of Smalltalk, Python, Ruby Wednesday, 16 June 2010
  • 14.
    Text Text Java . But also Groovy . original author of this slide is Marcel Overdijk - Wednesday, 16 June 2010
  • 15.
    • Dynamic typesusing the def keyword • Optional return types • Everything is public by default • Optional semicolons, parentheses • Variable interpolation via GStrings • Automatic setters and getters original author of this slide is Marcel Overdijk - Wednesday, 16 June 2010
  • 16.
    Healthy ecosystem • gPars - parallel processing • Groovy++ - static typing • Spock - data / behaviour driven testing and specifications framework • Gaelyk - lightweight web framework for the Google App Engine • Tellurium - automatic UI based testing framework based on Selenium. • Griffon - Swing / Desktop applications. Wednesday, 16 June 2010
  • 17.
    Cool Thing #3: 426 Plugins Wednesday, 16 June 2010
  • 18.
    Cool Thing #4:Flex + Flash Integration BlazeDS GraniteDS Grails Flex Scaffold Openlaszlo JW FLV Media Library sIFR Red5 Video Wednesday, 16 June 2010
  • 19.
    Building a Grails application ( woohoo! ) Wednesday, 16 June 2010
  • 20.
  • 21.
  • 22.
  • 23.
    Grails Flex Scaffold • Developed by Cubika in Argentina • Flex 3, Cairngorm, Stark Security @eapfel Wednesday, 16 June 2010
  • 24.
  • 25.
    BlazeDS plugin • Developed by Sébastien Arbogast • BlazeDS, Spring-Flex Integration • Spring Security @ sarbogast Wednesday, 16 June 2010
  • 26.
  • 27.
    Web Services • Sometimes we can’t use BlazeDS / AMF • REST - built in content negotiation • SOAP / WSDL - via plugins like XFire, CXF or Spring WS Wednesday, 16 June 2010
  • 28.
  • 29.
    Notes • The Java introspector in Flash Builder 4 does not work with Groovy classes, but you can use the DTO plugin to automatically generate Java DTOs and cast between Java / Groovy. • There are a few plugins that aid with Hibernate LazyInitialization issues. Gorm Labs, for example, dehydrates Hibernate sessions before being sent across the wire. • IDE Support is actually quite good. My IntelliJ trial expired yesterday. STS and Netbeans also do Grails. Wednesday, 16 June 2010
  • 30.
    Other uses. • Tag libraries for embedding SWFs, providing alternative content for SEO. • Adding server side search via Lucene or Solr. • Deployment platform for Amazon / App Engine. • A nice proxy to bypass Flash Security restrictions. • Backend glue to PHP / Clojure. • Data import / massaging. Wednesday, 16 June 2010
  • 31.
  • 32.
    Flex / GrailsWish List • Flash Builder extension for Grails • UI Testing automation • Integration with Model Driven Development / LiveCycle services. • A clear way to deal with Hibernate sessions. • A way to template frameworks like Parsley, Robotlegs or PureMVC • Better integration with messaging options. Wednesday, 16 June 2010
  • 33.
    Why do Ilike Grails? • Allows me to build backends to my Flex applications quickly and effectively. • Integrates well with existing Java libraries. • Lets me try new things fairly risk free. • Encourages modular development / re-use. • Constantly getting better. • Makes writing web applications fun. Wednesday, 16 June 2010
  • 34.
    Learn More! Wednesday, 16June 2010 grails.org/books
  • 35.
    Learn More! • http://www.grails.org • Come to the user group meetings. • Third Monday every month. Here. • Grails mailing list. • twitter: @tomaslin • email: tomaslin@gmail.com Wednesday, 16 June 2010
  • 36.