griffon at gateway gug

16
Griffon ... a Grails Developer’s Perspective

Upload: matthew-taylor

Post on 20-May-2015

1.485 views

Category:

Technology


6 download

DESCRIPTION

Presentation on Griffon for Gateway Groovy Users Group on March 10, 2009 by Matthew Taylor.

TRANSCRIPT

Page 1: Griffon at Gateway GUG

Griffon... a Grails Developer’s Perspective

Page 2: Griffon at Gateway GUG

Swing + Groovy + Grails

Page 3: Griffon at Gateway GUG

Wait... Swing?

Page 4: Griffon at Gateway GUG
Page 5: Griffon at Gateway GUG

BORDER LAYOUT

BOX LAYOUT

CARD LAYOUT

FLOW LAYOUT

GRID LAYOUT

SPRING LAYOUT

Page 6: Griffon at Gateway GUG

BORDER LAYOUT

BOX LAYOUT

CARD LAYOUT

FLOW LAYOUT

GRID LAYOUT

SPRING LAYOUTEVEN

T MADNESS

THREA

DING HELL

Page 7: Griffon at Gateway GUG

GRIDBAGLAYOUT

Page 8: Griffon at Gateway GUG

GRIDBAGLAYOUT

Page 9: Griffon at Gateway GUG

MVC Triad

VIEW

MODEL

CONTROLLER

bindings

actions

bindings

swing

Page 10: Griffon at Gateway GUG

Bindings

Can bind view components to view components

Model properties can be @Bindable and available from Controller and View

Validation is available within bindings

bind ( source: c1, sourceProperty: ‘text’ target: c2, targetProperty: ‘text’ )

Page 11: Griffon at Gateway GUG

Binding example (view)

def counter = 0application(title:'bindfun', pack:true, locationByPlatform:true) { gridLayout( cols:1, rows:2) button("Click me", id:'b') label(id:'lbl', text: bind( source: b, sourceEvent: 'actionPerformed', sourceValue: { counter++ }, converter: { lbl.text + it} ) )}

Page 12: Griffon at Gateway GUG

MVC Groups

MVC pattern can have a very small footprint

Can be in lots of places

Griffon’s MVC groups allows easy creation and deletion of MVC pattern

griffon create-mvc to create skeleton

createMVCGroup() to instantiate in running app

Page 13: Griffon at Gateway GUG

Image Viewer Demo

Page 14: Griffon at Gateway GUG

Plugins

10+ available

griffon list-plugins

griffon install-plugin myPlugin

Just like Grails

Page 15: Griffon at Gateway GUG

Thoughts

Swing is painful

Griffon is good

Missing documentation (only 0.1)

Great potential for growth

I wish I had this 3 years ago!