A presentation for the Vancouver Island Java User's Group showcasing how Groovy and the Griffon application framework can ease the pain of coding Swing applications.
developers on Griffon are contributors to Groovy and have provided handy AST transformations
What makes it “hard” to program Swing? VERBOSITY, boilerplate
What things does Groovy do to help? Builder pattern is great at building tree structures Helpful abstractions one line initialization, no need to call get/set
What does Griffon add to the mix to make it even easier? no need to remember which builder you are calling; conflicts can be resolved using namespaces standardization/delegation of methods: size(), getAt(), putAt(), iterator()
After this slide, demo CSSBuilder and some of the Swingpad samples Swingpad can be used to prototype UI elements in isolation, Mockfor and Stubfor can be used to mock dependencies
After this slide, show the files in IDE and explain they’re nothing more than properties files consumed by ConfigSlurper
show L&F change? build a new app from scratch, change from label to button, run, change L&F and rerun
Getting your application built and published is important - you do want people to use these things after all Point out that demos are all .app files
No framework would be complete without testing support Show FEST test after this slide
Polyglot programming made easy
Wrappers for SwingUtilities methods Demo Binding example
SwingWorker DSL Demo EDT example and Animation example
Here’s how you work with it at the lowest level. Demo loading up the application in a console
Just out of interest, the demo application created to go along with this talk comes in pretty lean. Lifecycle and Integration Tests are defaults And all of these LOC measures include comments, to be fixed in a release soon