SlideShare a Scribd company logo
1 of 50
Download to read offline
Introduction to
                            Creating a Griffon: Rich Client front-end to our
                                             Twitter Clone

                                            By Jim Shingler




           © Jim Shingler

Wednesday, May 13, 2009                                                        1
Abstract
            Groovy and Grails have given us the ability to leverage the
            strength of the Java Platform (and Eco System) and
            the productivity of “Convention over
            Configuration” to construct websites. But “What If” the
            User Interface requirements of the new application is best
            solved with the type of interaction a desktop application
            provides?

            Griffon bring the same productivity gains to the
            desktop application that Grails brings to web
            applications. This session will use Griffon and popular open
            source libraries to build a desktop application to interact with
            a Grails backend.
           © Jim Shingler

Wednesday, May 13, 2009                                                        2
Introduction
                    My name is Jim Shingler
                    Chief Technical Architect
                    President of Genuine Solutions
                    Beginning Groovy and Grails Co-Author
                    FallME (Inversion of Control for JavaME) Co-Founder
                    Griffon Splash Plugin Author
                    Griffon gConfig Author
                    Griffon TM Bundle Author
           © Jim Shingler

Wednesday, May 13, 2009                                                   3
Agenda
                                   Griffon 101
                                    •What is Griffon
                                    •Installing Griffon
                                    •0 -100 k/mph in 60 seconds
                            </xml>
                                    •Plugins Overview
                                    •Teaching the Griffon to count
                                    (Binding and Threading)
                                    •Readying Graeme’s Twitter Clone
                                   Griffon 201
                                    •Griffon Twitter Client
           © Jim Shingler

Wednesday, May 13, 2009                                                4
Installing Griffon

                     1. Download Griffon
                     2. Unpack it
                        (unix: /opt/local/share/ windows: /apps/griffon)
                     3. Set the GROOVY_HOME
                     4. Add it to your path, <GROOVY_HOME>/bin


           © Jim Shingler

Wednesday, May 13, 2009                                                    5
0-100 k/mph
                            in 60 Seconds
                   > griffon create-app small
                   Welcome to Griffon 0.1.0 - http://griffon.codehaus.org/
                   Licensed under Apache Standard License 2.0
                   Griffon home is set to: /opt/local/share/griffon-0.1.0
                   ...
                   > griffon run-app

           © Jim Shingler

Wednesday, May 13, 2009                                                      6
DEMO
           © Jim Shingler

Wednesday, May 13, 2009            7
Congratulations
                            you are a




                            Developer

           © Jim Shingler

Wednesday, May 13, 2009                 8
Don’t
              forget to
                update
                 your
               resume.


                            Griffon



           © Jim Shingler

Wednesday, May 13, 2009               9
App Structure
                            & Convention
                  A pretty standard application
                structure, . . . you can pretty well
               guess the purpose of the files and
                           directories.




           © Jim Shingler

Wednesday, May 13, 2009                                10
Griffon Commands




           © Jim Shingler

Wednesday, May 13, 2009                        11
Plugins




           © Jim Shingler

Wednesday, May 13, 2009               12
Start Small
                     • Swing and SwingX Builder
                     • GUI Components
                     • About Box
                     • Define and Process Actions


           © Jim Shingler

Wednesday, May 13, 2009                            13
DEMO
                • Create Count App
                • Add Button
                • Build and Initialize “Click Action”
                • Process the Click Action
                • Install and Enable SwingXBuilder
                • Build and Initialize Menus
                • Build and Initialize “Menu Actions”
                • Process the Menu Actions
           © Jim Shingler

Wednesday, May 13, 2009                                 14
Controller
                    import javax.swing.JOptionPane

                    class CountingController {
                        // these will be injected by Griffon
                        def model
                        def view
                        def builder

                            void mvcGroupInit(Map args) {
                                // this method is called after model and view are injected
                            }

                            def click = { evt = null ->
                                 model.count++
                            }

                            def exit = { evt = null ->
                                app.shutdown()
                            }

                            def showAbout = { evt = null ->
                                 builder.optionPane().showMessageDialog(null,
                                   'This is the Counting Application')
                            }
                    }

           © Jim Shingler

Wednesday, May 13, 2009                                                                      15
Model
                               import groovy.beans.Bindable
              Adds Property    @Bindable

              Change Support   class CountingModel {
                                   def count = 0
                               }
               to the model




           © Jim Shingler

Wednesday, May 13, 2009                                       16
View and Menu
                                View
              application(title:'sample2', /*size:[320,480], */location:[200,200],
              pack:true, locationByPlatform:false) {
                  // add content here
                  build(Actions)                  Loads and runs Actions and MenuBar scripts   inline
                  build(MenuBar)
                  button(id:'clickButton', text:bind{ model.count }, action: clickAction)
              }


    Data Binding. Observe
   the change in the model             MenuBar                           Execute the “clickAction”


                                 jxmenuBar {
                                     menu(text: 'File', mnemonic: 'F') {
                                         menuItem(exitAction)              Use the action to define
                                     }                                         the menu item
                                     glue()
                                     menu(text: 'Help', mnemonic: 'H') {
                                         menuItem(aboutAction)
                                     }
                                 }
           © Jim Shingler

Wednesday, May 13, 2009                                                                                 17
Actions
                            // create the actions
                                                                                     Closure to run when
                            action(id: 'clickAction',                                    the action is
                                     name: 'Click Me',                                     executed
                                     closure: controller.&click,
                                     shortDescription: 'Increment the Click Count'
                                     )

                            action(id: 'exitAction',
                                     name: 'Exit', closure: controller.exit,
                                     mnemonic: 'x', accelerator: 'F4',
                                     shortDescription: 'Exit SimpleUI'
                                     )

                            action(id: 'aboutAction',
                                     name: 'About', closure: controller.showAbout,
                                     mnemonic: 'A', accelerator: 'F1',
                                     shortDescription: 'Find out about SimpleUI'
                                     )




           © Jim Shingler

Wednesday, May 13, 2009                                                                                18
Threading the GUI




                                It isn’t that bad
           © Jim Shingler

Wednesday, May 13, 2009                             19
Rules of Thumb

               •            Painting and UI Operations need to be done in the
                            EventDispatchThread (EDT)

               •            Everything else should be done outside the EDT

               •            Java 6 has SwingWorker, Java 5 has SwingLabs Swingworker




            But that just isn’t Groovy enough for Griffon
           © Jim Shingler

Wednesday, May 13, 2009                                                            20
Griffon Threading
                     • Build the UI in the EDT
                            SwingBuilder.build { . . . }
                     • Long Running code outside the EDT
                            doOutside { . . . }               Creates thread and runs closure


                     • code inside the EDT
                            edt { . . . }    Do synchronously in EDT

                            doLater { . . . }       Do asynchronously in EDT



           © Jim Shingler

Wednesday, May 13, 2009                                                                         21
DEMO

           © Jim Shingler

Wednesday, May 13, 2009            22
Model
                            import groovy.beans.Bindable

                            @Bindable
                            class CountingModel {
                                def count = 0
                                def countSlow = 0
                                def countConcurrent = 0
                            }




           © Jim Shingler

Wednesday, May 13, 2009                                    23
View
           application(title:'counting', /*size:[320,480], location:[50,50],*/
                         pack:true, locationByPlatform:true) {
               build(Actions)
               build(MenuBar)

                   gridLayout()
                   button(id:'clickButton',
                          text:bind {model.count}, action: clickAction)
                   label(text:bind {model.count})

                   button(id:'slowClickButton', text:"Slow Click", action: slowClickAction)
                   label(text:bind {model.countSlow})

                   button(id:'concurrentClickButton', text:"Concurrent Click", action: concurrentClickAction)
                   label(text:bind {model.countConcurrent})
           }




           © Jim Shingler

Wednesday, May 13, 2009                                                                                         24
Actions
                       // create the actions
                       action(id: 'clickAction',
                       	   	   name: 'Click', closure: controller.&click,
                       	   	   shortDescription: 'Increment the Click Count'
                       	   	   )

                       action(id: 'clickActionSlow',
                       	   	   name: 'Click Slow', closure: controller.&clickSlow,
                       	   	   shortDescription: 'Increment the Click Count Slow'
                       	   	   )
                       	   	
                       action(id: 'clickActionConcurrent',
                       	   	   name: 'Click Concurrent', closure: controller.&clickConcurrent,
                       	   	   shortDescription: 'Increment the Click Count Concurrent'
                       	   	   )

                       action(id: 'exitAction',
                       	   	   name: 'Exit', closure: controller.exit,
                       	   	   mnemonic: 'x', accelerator: 'F4',
                       	   	   shortDescription: 'Exit SimpleUI'
                       	   	   )

                       action(id: 'aboutAction',
                       	   	   name: 'About', closure: controller.showAbout,
                       	   	   mnemonic: 'A', accelerator: 'F1',
                       	   	   shortDescription: 'Find out about SimpleUI'
                       	   	   )
           © Jim Shingler

Wednesday, May 13, 2009                                                                          25
Controller
                            import javax.swing.JOptionPane
                            class CountingController {
                            	   // these will be injected by Griffon
                            	   def model
                            	   def view
                            	   void mvcGroupInit(Map args) { }
                            	
                            	   def click = { evt -> model.count++ }
                            	
                            	   def clickSlow = { evt = null ->
                            	   	 Thread.sleep(5000)
                            	   	 model.countSlow++
                            	   }
                            	
                            	   def clickConcurrent = { evt = null ->
                            	   	 doOutside {
                            	   	 	 Thread.sleep(5000)
                            	   	 	 edt { // Sync
                            	   	 	        model.countConcurrent++
                            	   	 	 }
                            	   	 }
                            	   }
                            	
                            	   def   exit = { evt = null -> System.exit(0) }
                            	   def   showAbout = { evt = null ->
                            	   	     JOptionPane.showMessageDialog(null,
                            	   	     '''This is the SimpleUI Application''')
                            	   }
                            }
           © Jim Shingler

Wednesday, May 13, 2009                                                         26
Twitter Clone
             Enhancements
           © Jim Shingler

Wednesday, May 13, 2009      27
Render Status XML
               import grails.converters.*

                class StatusController {
                          def twitterCache
                          def index = {
                	 	 def messages = twitterCache.get(principalInfo.username)?.value
                	 	 if(!messages) {
                	 	 	 messages = findStatusMessages()
                	 	 	 twitterCache.put new Element(principalInfo.username, messages)
                	 	 }
                	 	
                	 	 def feedOutput = {
                	 	 	 . . .
                	 	 }
                	 	
                	 	 withFormat {
                	 	 	 html([messages:messages])
                	 	 	 xml { render messages as XML}
                	 	 	 rss { render(feedType:"rss", feedOutput)}
                	 	 }
                	 }
                . . .
           © Jim Shingler

Wednesday, May 13, 2009                                                                28
Render Person XML
                import grails.converters.*

                class PersonController {

                ...
                
                              def findByUsername = {
                
           
     def p = Person.findByUsername(params.username)
                
           
     withFormat {
                
           
     
    html person:p
                
           
     
    xml { render p as XML }
                
           
     }
                
           }

                ...




           © Jim Shingler

Wednesday, May 13, 2009                                                           29
def show = {
                   
    
   def person = Person.get(params.id)
                   
    
   if (!person) {
                   
    
   
     flash.message = "Person not found with id $params.id"
                   
    
   
     redirect action: list
                   
    
   
     return
                   
    
   }
                   
    
   List roleNames = []
                   
    
   for (role in person.authorities) {
                   
    
   
     roleNames << role.authority
                   
    
   }
                   
    
   roleNames.sort { n1, n2 ->
                   
    
   
     n1 <=> n2
                   
    
   }
                   
    
   withFormat {
                   
    
   
     html ( [person: person, roleNames: roleNames] )
                   
    
   
     xml { render person as XML }
                   
    
   }
                   
    //
 [person: person, roleNames: roleNames]
                   
    }
           © Jim Shingler

Wednesday, May 13, 2009                                                                  30
Acegi Basic
                                 Authentication
           grails-app/conf/SecurityConfig.groovy
             security {

             	       // see DefaultSecurityConfig.groovy for all settable/overridable properties

             	       active = true
             	
             	       basicProcessingFilter = true

             	       loginUserDomainClass = "Person"
             	       authorityDomainClass = "Authority"
             	       requestMapClass = "Requestmap"

             }




           © Jim Shingler

Wednesday, May 13, 2009                                                                            31
Acegi Basic
                            Authentication
           grails-app/conf/spring/resources.groovy
            beans = {
            	 authenticationEntryPoint(org.springframework.security.ui.basicauth.
                                       BasicProcessingFilterEntryPoint) {
            	 realmName = 'Grails Realm'
            	 }
            	
            	 twitterCache(org.springframework.cache.ehcache.EhCacheFactoryBean) {
            	 	 timeToLive = 1200
            	 }
            	

            }




           © Jim Shingler

Wednesday, May 13, 2009                                                              32
Griffon Twitter
            Clone Client
           © Jim Shingler

Wednesday, May 13, 2009      33
Requirements

                     • Login
                     • Display User Info
                     • Display Statuses (Tweets)
                     • Update Statuses(Tweets)
                     • Send My Own Status (Tweet)
           © Jim Shingler

Wednesday, May 13, 2009                             34
Overview
                                MVC Triad
                                                 MenuBar
                       Controller         View
                                                 ToolBar

                                                 StatusBar
                                 Model             Tips

                                                  About

               Twitter Service

                            </xml>


                   Twitter Clone
           © Jim Shingler

Wednesday, May 13, 2009                                      35
Let’s get to
                              Work
           © Jim Shingler

Wednesday, May 13, 2009                    36
Login   Refresh   ToolBar

                                                    User Info



                                                  Statuses / Tweets




                    Update
                    Status




           © Jim Shingler

Wednesday, May 13, 2009                                               37
© Jim Shingler

Wednesday, May 13, 2009     38
Other Griffon
                  Apps
           © Jim Shingler

Wednesday, May 13, 2009        39
© Jim Shingler

Wednesday, May 13, 2009     40
© Jim Shingler

Wednesday, May 13, 2009     41
© Jim Shingler

Wednesday, May 13, 2009     42
© Jim Shingler

Wednesday, May 13, 2009     43
© Jim Shingler

Wednesday, May 13, 2009     44
© Jim Shingler

Wednesday, May 13, 2009     45
The Code
                     http://github.com/jshingler/gr8conf_2009/tree/master




           © Jim Shingler

Wednesday, May 13, 2009                                                     46
Founders

                            Danno Ferrin
                            http://shemnon.com/speling

                            Andres Almiray
                            http://jroller.com/aalmiray

                            James Williams
                            http://jameswilliams.be/blog
           © Jim Shingler

Wednesday, May 13, 2009                                    47
Resources
                • Griffon
                  • griffon.codehause.org
                  • griffon-user@groovy.codehause.org
                • Grails
                  • www.grails.org
                                                 Coming
                • Books                           Soon




           © Jim Shingler

Wednesday, May 13, 2009                                   48
Resources
                • dev@griffon.codehaus.org is a medium volume list
                  useful for those interested in ongoing
                  developments
                • scm@griffon.codehaus.org 
is a high volume list
                  that logs commits and issues
                • user@griffon.codehaus.org 
is a high volume list is
                  for questions and general discussion about Griffon
                • You can find a great archive support at MarkMail,
                  http://griffon.markmail.org.

           © Jim Shingler

Wednesday, May 13, 2009                                                 49
Conclusion
             Thank You for your time
                   •        Blog:
                            http://jshingler.blogspot.com

                   •        Email:
                            ShinglerJim@gmail.com

                   •        LinkedIn:
                            http://www.linkedin.com/in/jimshingler

                   •        Twitter:
                            @jshingler
           © Jim Shingler

Wednesday, May 13, 2009                                              50

More Related Content

Similar to GR8Conf 2009: Griffon by Jim Shingler

Getting started with caliburn.micro and windows phone 7
Getting started with caliburn.micro and windows phone 7Getting started with caliburn.micro and windows phone 7
Getting started with caliburn.micro and windows phone 7Gary Park
 
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad AssisKubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad AssisAgileSparks
 
BP104 Have it YOUR way amd make it work for YOU
BP104 Have it YOUR way amd make it work for YOUBP104 Have it YOUR way amd make it work for YOU
BP104 Have it YOUR way amd make it work for YOUMat Newman
 
JVM Multitenancy (JavaOne 2012)
JVM Multitenancy (JavaOne 2012)JVM Multitenancy (JavaOne 2012)
JVM Multitenancy (JavaOne 2012)Graeme_IBM
 
Ryan Campbell - OpenFlux and Flex 4
Ryan Campbell - OpenFlux and Flex 4Ryan Campbell - OpenFlux and Flex 4
Ryan Campbell - OpenFlux and Flex 4360|Conferences
 
Prince&Scrum: Unexpected Partners Handout
Prince&Scrum: Unexpected Partners HandoutPrince&Scrum: Unexpected Partners Handout
Prince&Scrum: Unexpected Partners HandoutEelco Gravendeel
 
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
JavaOne 2013: Garbage Collection Unleashed - Demystifying the WizardryJavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
JavaOne 2013: Garbage Collection Unleashed - Demystifying the WizardryRyan Sciampacone
 
GitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CDGitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CDRakuten Group, Inc.
 
Evaluation Q6.
Evaluation Q6.Evaluation Q6.
Evaluation Q6.samwadsted
 
Scrum Out Of The Nutshell
Scrum Out Of The NutshellScrum Out Of The Nutshell
Scrum Out Of The NutshellDougShimp
 
Scrum Out Of The Nutshell V3
Scrum Out Of The Nutshell V3Scrum Out Of The Nutshell V3
Scrum Out Of The Nutshell V3Doug Shimp
 
Agile is the New Black
Agile is the New BlackAgile is the New Black
Agile is the New BlackFred George
 
Image Principles.pptx
Image Principles.pptxImage Principles.pptx
Image Principles.pptxLeoOrtega19
 
Zimbra scripting with python
Zimbra scripting with pythonZimbra scripting with python
Zimbra scripting with pythonImam Omar Mochtar
 
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekomDroidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekomDroidcon Berlin
 
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForgeMobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForgeLuca Milanesio
 

Similar to GR8Conf 2009: Griffon by Jim Shingler (18)

Getting started with caliburn.micro and windows phone 7
Getting started with caliburn.micro and windows phone 7Getting started with caliburn.micro and windows phone 7
Getting started with caliburn.micro and windows phone 7
 
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad AssisKubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
Kubernetes is Hard! Lessons Learned Taking Our Apps to Kubernetes by Eldad Assis
 
BP104 Have it YOUR way amd make it work for YOU
BP104 Have it YOUR way amd make it work for YOUBP104 Have it YOUR way amd make it work for YOU
BP104 Have it YOUR way amd make it work for YOU
 
JVM Multitenancy (JavaOne 2012)
JVM Multitenancy (JavaOne 2012)JVM Multitenancy (JavaOne 2012)
JVM Multitenancy (JavaOne 2012)
 
Ryan Campbell - OpenFlux and Flex 4
Ryan Campbell - OpenFlux and Flex 4Ryan Campbell - OpenFlux and Flex 4
Ryan Campbell - OpenFlux and Flex 4
 
Prince&Scrum: Unexpected Partners Handout
Prince&Scrum: Unexpected Partners HandoutPrince&Scrum: Unexpected Partners Handout
Prince&Scrum: Unexpected Partners Handout
 
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
JavaOne 2013: Garbage Collection Unleashed - Demystifying the WizardryJavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
JavaOne 2013: Garbage Collection Unleashed - Demystifying the Wizardry
 
GitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CDGitOps, Jenkins X &Future of CI/CD
GitOps, Jenkins X &Future of CI/CD
 
Evaluation Q6.
Evaluation Q6.Evaluation Q6.
Evaluation Q6.
 
Scrum Out Of The Nutshell
Scrum Out Of The NutshellScrum Out Of The Nutshell
Scrum Out Of The Nutshell
 
Scrum Out Of The Nutshell V3
Scrum Out Of The Nutshell V3Scrum Out Of The Nutshell V3
Scrum Out Of The Nutshell V3
 
Agile is the New Black
Agile is the New BlackAgile is the New Black
Agile is the New Black
 
Griffon demo
Griffon demoGriffon demo
Griffon demo
 
Ci Presentation for SPIN
Ci Presentation for SPINCi Presentation for SPIN
Ci Presentation for SPIN
 
Image Principles.pptx
Image Principles.pptxImage Principles.pptx
Image Principles.pptx
 
Zimbra scripting with python
Zimbra scripting with pythonZimbra scripting with python
Zimbra scripting with python
 
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekomDroidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
Droidcon2013 helleberg kruemmling_androidgoesreading_inovex_telekom
 
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForgeMobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
Mobile Application Lifecycle with Jekins, Trello and CollabNet TeamForge
 

More from GR8Conf

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle GR8Conf
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerGR8Conf
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with GroovyGR8Conf
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with GebGR8Conf
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidGR8Conf
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the DocksGR8Conf
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean CodeGR8Conf
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsGR8Conf
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applicationsGR8Conf
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3GR8Conf
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGR8Conf
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEBGR8Conf
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCGR8Conf
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshopGR8Conf
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spockGR8Conf
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedGR8Conf
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGR8Conf
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyGR8Conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 

More from GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 

Recently uploaded

8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCRashishs7044
 
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxContemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxMarkAnthonyAurellano
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCRashishs7044
 
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfrichard876048
 
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / NcrCall Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncrdollysharma2066
 
IoT Insurance Observatory: summary 2024
IoT Insurance Observatory:  summary 2024IoT Insurance Observatory:  summary 2024
IoT Insurance Observatory: summary 2024Matteo Carbone
 
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...ictsugar
 
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City GurgaonCall Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaoncallgirls2057
 
Future Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionFuture Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionMintel Group
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Seta Wicaksana
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckHajeJanKamps
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCRashishs7044
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis UsageNeil Kimberley
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationAnamaria Contreras
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...ssuserf63bd7
 
Kenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby AfricaKenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby Africaictsugar
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyotictsugar
 
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...ShrutiBose4
 

Recently uploaded (20)

8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
8447779800, Low rate Call girls in New Ashok Nagar Delhi NCR
 
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptxContemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
Contemporary Economic Issues Facing the Filipino Entrepreneur (1).pptx
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
 
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdf
 
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / NcrCall Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
Call Girls in DELHI Cantt, ( Call Me )-8377877756-Female Escort- In Delhi / Ncr
 
IoT Insurance Observatory: summary 2024
IoT Insurance Observatory:  summary 2024IoT Insurance Observatory:  summary 2024
IoT Insurance Observatory: summary 2024
 
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...Global Scenario On Sustainable  and Resilient Coconut Industry by Dr. Jelfina...
Global Scenario On Sustainable and Resilient Coconut Industry by Dr. Jelfina...
 
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City GurgaonCall Us 📲8800102216📞 Call Girls In DLF City Gurgaon
Call Us 📲8800102216📞 Call Girls In DLF City Gurgaon
 
Future Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted VersionFuture Of Sample Report 2024 | Redacted Version
Future Of Sample Report 2024 | Redacted Version
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...
 
Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
8447779800, Low rate Call girls in Shivaji Enclave Delhi NCR
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
 
International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...International Business Environments and Operations 16th Global Edition test b...
International Business Environments and Operations 16th Global Edition test b...
 
Kenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby AfricaKenya’s Coconut Value Chain by Gatsby Africa
Kenya’s Coconut Value Chain by Gatsby Africa
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyot
 
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
Ms Motilal Padampat Sugar Mills vs. State of Uttar Pradesh & Ors. - A Milesto...
 

GR8Conf 2009: Griffon by Jim Shingler

  • 1. Introduction to Creating a Griffon: Rich Client front-end to our Twitter Clone By Jim Shingler © Jim Shingler Wednesday, May 13, 2009 1
  • 2. Abstract Groovy and Grails have given us the ability to leverage the strength of the Java Platform (and Eco System) and the productivity of “Convention over Configuration” to construct websites. But “What If” the User Interface requirements of the new application is best solved with the type of interaction a desktop application provides? Griffon bring the same productivity gains to the desktop application that Grails brings to web applications. This session will use Griffon and popular open source libraries to build a desktop application to interact with a Grails backend. © Jim Shingler Wednesday, May 13, 2009 2
  • 3. Introduction My name is Jim Shingler Chief Technical Architect President of Genuine Solutions Beginning Groovy and Grails Co-Author FallME (Inversion of Control for JavaME) Co-Founder Griffon Splash Plugin Author Griffon gConfig Author Griffon TM Bundle Author © Jim Shingler Wednesday, May 13, 2009 3
  • 4. Agenda Griffon 101 •What is Griffon •Installing Griffon •0 -100 k/mph in 60 seconds </xml> •Plugins Overview •Teaching the Griffon to count (Binding and Threading) •Readying Graeme’s Twitter Clone Griffon 201 •Griffon Twitter Client © Jim Shingler Wednesday, May 13, 2009 4
  • 5. Installing Griffon 1. Download Griffon 2. Unpack it (unix: /opt/local/share/ windows: /apps/griffon) 3. Set the GROOVY_HOME 4. Add it to your path, <GROOVY_HOME>/bin © Jim Shingler Wednesday, May 13, 2009 5
  • 6. 0-100 k/mph in 60 Seconds > griffon create-app small Welcome to Griffon 0.1.0 - http://griffon.codehaus.org/ Licensed under Apache Standard License 2.0 Griffon home is set to: /opt/local/share/griffon-0.1.0 ... > griffon run-app © Jim Shingler Wednesday, May 13, 2009 6
  • 7. DEMO © Jim Shingler Wednesday, May 13, 2009 7
  • 8. Congratulations you are a Developer © Jim Shingler Wednesday, May 13, 2009 8
  • 9. Don’t forget to update your resume. Griffon © Jim Shingler Wednesday, May 13, 2009 9
  • 10. App Structure & Convention A pretty standard application structure, . . . you can pretty well guess the purpose of the files and directories. © Jim Shingler Wednesday, May 13, 2009 10
  • 11. Griffon Commands © Jim Shingler Wednesday, May 13, 2009 11
  • 12. Plugins © Jim Shingler Wednesday, May 13, 2009 12
  • 13. Start Small • Swing and SwingX Builder • GUI Components • About Box • Define and Process Actions © Jim Shingler Wednesday, May 13, 2009 13
  • 14. DEMO • Create Count App • Add Button • Build and Initialize “Click Action” • Process the Click Action • Install and Enable SwingXBuilder • Build and Initialize Menus • Build and Initialize “Menu Actions” • Process the Menu Actions © Jim Shingler Wednesday, May 13, 2009 14
  • 15. Controller import javax.swing.JOptionPane class CountingController { // these will be injected by Griffon def model def view def builder void mvcGroupInit(Map args) { // this method is called after model and view are injected } def click = { evt = null -> model.count++ } def exit = { evt = null -> app.shutdown() } def showAbout = { evt = null -> builder.optionPane().showMessageDialog(null, 'This is the Counting Application') } } © Jim Shingler Wednesday, May 13, 2009 15
  • 16. Model import groovy.beans.Bindable Adds Property @Bindable Change Support class CountingModel { def count = 0 } to the model © Jim Shingler Wednesday, May 13, 2009 16
  • 17. View and Menu View application(title:'sample2', /*size:[320,480], */location:[200,200], pack:true, locationByPlatform:false) { // add content here build(Actions) Loads and runs Actions and MenuBar scripts inline build(MenuBar) button(id:'clickButton', text:bind{ model.count }, action: clickAction) } Data Binding. Observe the change in the model MenuBar Execute the “clickAction” jxmenuBar { menu(text: 'File', mnemonic: 'F') { menuItem(exitAction) Use the action to define } the menu item glue() menu(text: 'Help', mnemonic: 'H') { menuItem(aboutAction) } } © Jim Shingler Wednesday, May 13, 2009 17
  • 18. Actions // create the actions Closure to run when action(id: 'clickAction', the action is name: 'Click Me', executed closure: controller.&click, shortDescription: 'Increment the Click Count' ) action(id: 'exitAction', name: 'Exit', closure: controller.exit, mnemonic: 'x', accelerator: 'F4', shortDescription: 'Exit SimpleUI' ) action(id: 'aboutAction', name: 'About', closure: controller.showAbout, mnemonic: 'A', accelerator: 'F1', shortDescription: 'Find out about SimpleUI' ) © Jim Shingler Wednesday, May 13, 2009 18
  • 19. Threading the GUI It isn’t that bad © Jim Shingler Wednesday, May 13, 2009 19
  • 20. Rules of Thumb • Painting and UI Operations need to be done in the EventDispatchThread (EDT) • Everything else should be done outside the EDT • Java 6 has SwingWorker, Java 5 has SwingLabs Swingworker But that just isn’t Groovy enough for Griffon © Jim Shingler Wednesday, May 13, 2009 20
  • 21. Griffon Threading • Build the UI in the EDT SwingBuilder.build { . . . } • Long Running code outside the EDT doOutside { . . . } Creates thread and runs closure • code inside the EDT edt { . . . } Do synchronously in EDT doLater { . . . } Do asynchronously in EDT © Jim Shingler Wednesday, May 13, 2009 21
  • 22. DEMO © Jim Shingler Wednesday, May 13, 2009 22
  • 23. Model import groovy.beans.Bindable @Bindable class CountingModel { def count = 0 def countSlow = 0 def countConcurrent = 0 } © Jim Shingler Wednesday, May 13, 2009 23
  • 24. View application(title:'counting', /*size:[320,480], location:[50,50],*/ pack:true, locationByPlatform:true) { build(Actions) build(MenuBar) gridLayout() button(id:'clickButton', text:bind {model.count}, action: clickAction) label(text:bind {model.count}) button(id:'slowClickButton', text:"Slow Click", action: slowClickAction) label(text:bind {model.countSlow}) button(id:'concurrentClickButton', text:"Concurrent Click", action: concurrentClickAction) label(text:bind {model.countConcurrent}) } © Jim Shingler Wednesday, May 13, 2009 24
  • 25. Actions // create the actions action(id: 'clickAction', name: 'Click', closure: controller.&click, shortDescription: 'Increment the Click Count' ) action(id: 'clickActionSlow', name: 'Click Slow', closure: controller.&clickSlow, shortDescription: 'Increment the Click Count Slow' ) action(id: 'clickActionConcurrent', name: 'Click Concurrent', closure: controller.&clickConcurrent, shortDescription: 'Increment the Click Count Concurrent' ) action(id: 'exitAction', name: 'Exit', closure: controller.exit, mnemonic: 'x', accelerator: 'F4', shortDescription: 'Exit SimpleUI' ) action(id: 'aboutAction', name: 'About', closure: controller.showAbout, mnemonic: 'A', accelerator: 'F1', shortDescription: 'Find out about SimpleUI' ) © Jim Shingler Wednesday, May 13, 2009 25
  • 26. Controller import javax.swing.JOptionPane class CountingController { // these will be injected by Griffon def model def view void mvcGroupInit(Map args) { } def click = { evt -> model.count++ } def clickSlow = { evt = null -> Thread.sleep(5000) model.countSlow++ } def clickConcurrent = { evt = null -> doOutside { Thread.sleep(5000) edt { // Sync model.countConcurrent++ } } } def exit = { evt = null -> System.exit(0) } def showAbout = { evt = null -> JOptionPane.showMessageDialog(null, '''This is the SimpleUI Application''') } } © Jim Shingler Wednesday, May 13, 2009 26
  • 27. Twitter Clone Enhancements © Jim Shingler Wednesday, May 13, 2009 27
  • 28. Render Status XML import grails.converters.* class StatusController { def twitterCache def index = { def messages = twitterCache.get(principalInfo.username)?.value if(!messages) { messages = findStatusMessages() twitterCache.put new Element(principalInfo.username, messages) } def feedOutput = { . . . } withFormat { html([messages:messages]) xml { render messages as XML} rss { render(feedType:"rss", feedOutput)} } } . . . © Jim Shingler Wednesday, May 13, 2009 28
  • 29. Render Person XML import grails.converters.* class PersonController { ... def findByUsername = { def p = Person.findByUsername(params.username) withFormat { html person:p xml { render p as XML } } } ... © Jim Shingler Wednesday, May 13, 2009 29
  • 30. def show = { def person = Person.get(params.id) if (!person) { flash.message = "Person not found with id $params.id" redirect action: list return } List roleNames = [] for (role in person.authorities) { roleNames << role.authority } roleNames.sort { n1, n2 -> n1 <=> n2 } withFormat { html ( [person: person, roleNames: roleNames] ) xml { render person as XML } } // [person: person, roleNames: roleNames] } © Jim Shingler Wednesday, May 13, 2009 30
  • 31. Acegi Basic Authentication grails-app/conf/SecurityConfig.groovy security { // see DefaultSecurityConfig.groovy for all settable/overridable properties active = true basicProcessingFilter = true loginUserDomainClass = "Person" authorityDomainClass = "Authority" requestMapClass = "Requestmap" } © Jim Shingler Wednesday, May 13, 2009 31
  • 32. Acegi Basic Authentication grails-app/conf/spring/resources.groovy beans = { authenticationEntryPoint(org.springframework.security.ui.basicauth. BasicProcessingFilterEntryPoint) { realmName = 'Grails Realm' } twitterCache(org.springframework.cache.ehcache.EhCacheFactoryBean) { timeToLive = 1200 } } © Jim Shingler Wednesday, May 13, 2009 32
  • 33. Griffon Twitter Clone Client © Jim Shingler Wednesday, May 13, 2009 33
  • 34. Requirements • Login • Display User Info • Display Statuses (Tweets) • Update Statuses(Tweets) • Send My Own Status (Tweet) © Jim Shingler Wednesday, May 13, 2009 34
  • 35. Overview MVC Triad MenuBar Controller View ToolBar StatusBar Model Tips About Twitter Service </xml> Twitter Clone © Jim Shingler Wednesday, May 13, 2009 35
  • 36. Let’s get to Work © Jim Shingler Wednesday, May 13, 2009 36
  • 37. Login Refresh ToolBar User Info Statuses / Tweets Update Status © Jim Shingler Wednesday, May 13, 2009 37
  • 38. © Jim Shingler Wednesday, May 13, 2009 38
  • 39. Other Griffon Apps © Jim Shingler Wednesday, May 13, 2009 39
  • 40. © Jim Shingler Wednesday, May 13, 2009 40
  • 41. © Jim Shingler Wednesday, May 13, 2009 41
  • 42. © Jim Shingler Wednesday, May 13, 2009 42
  • 43. © Jim Shingler Wednesday, May 13, 2009 43
  • 44. © Jim Shingler Wednesday, May 13, 2009 44
  • 45. © Jim Shingler Wednesday, May 13, 2009 45
  • 46. The Code http://github.com/jshingler/gr8conf_2009/tree/master © Jim Shingler Wednesday, May 13, 2009 46
  • 47. Founders Danno Ferrin http://shemnon.com/speling Andres Almiray http://jroller.com/aalmiray James Williams http://jameswilliams.be/blog © Jim Shingler Wednesday, May 13, 2009 47
  • 48. Resources • Griffon • griffon.codehause.org • griffon-user@groovy.codehause.org • Grails • www.grails.org Coming • Books Soon © Jim Shingler Wednesday, May 13, 2009 48
  • 49. Resources • dev@griffon.codehaus.org is a medium volume list useful for those interested in ongoing developments • scm@griffon.codehaus.org is a high volume list that logs commits and issues • user@griffon.codehaus.org is a high volume list is for questions and general discussion about Griffon • You can find a great archive support at MarkMail, http://griffon.markmail.org. © Jim Shingler Wednesday, May 13, 2009 49
  • 50. Conclusion Thank You for your time • Blog: http://jshingler.blogspot.com • Email: ShinglerJim@gmail.com • LinkedIn: http://www.linkedin.com/in/jimshingler • Twitter: @jshingler © Jim Shingler Wednesday, May 13, 2009 50