SlideShare a Scribd company logo
1 of 49
Download to read offline
Grails Goto Plugins
                               Eric Sword




February 15, 2012    Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   1
Who am I
●    Professional geek for 17 years
●    Turned management refugee in 2005
●    Now full-time dev and tech lead for SAIC
●    Java '97, Groovy '07, Grails '09
●    Blog: http://www.swordsystems.com
●    ericsword@gmail.com

February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   2
This Presentation
 ●   Start from nothing - almost
 ●   Full app in 1 hour

     DB Persistence              Authentication                    Audit Logging
     Load Monitoring             DB Monitoring                     Remote Debugging
     Unit Tests                  Integration Tests                 Functional Tests
     Test Data Fixtures          Lucene Indexes                    Tags and Tag Clouds




February 15, 2012         Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword       3
Get the Code
 ●   https://github.com/esword/grails-plugin-sandbox




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   4
All Together Now

                Groovy on Rails
                Groovy on Grails
                    Grails
February 15, 2012    Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   5
Grails Recipe
    ●   Take most popular Java web techs




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   6
●   Apply dollop of groovy glue
     ●   Conventions from top to bottom
     ●   Minimal boiler plate code




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   7
Your Choice of 745 Fixings
    ●




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   8
Bake with fully integrated
                   testing tools




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   9
Enjoy!
    ●   Full stack web-application framework




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   10
Running App in 3 Lines
    ●   grails create-app bookstore
    ●   cd bookstore
    ●   grails run-app




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   11
Add MVC
    ●   create-domain-class Author
    ●   cre<tab> Book
    ●   create-scaffold-controller <tab> Author
    ●   <up arrow> Book




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   12
Define Domain




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   13
New in 2.0
    ●   Much improved interactive shell
    ●   Better class reloading
    ●   Web-based dbconsole




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   14
dbconsole
    ●   drool,drool, drool




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   15
Get Real
    ●   Authentication
    ●   Test Data
    ●   Testing
    ●   Audit Logging
    ●   Monitoring



February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   16
IDE Integration
    ●   Intellij Rocks
                    –   Does require $ for Ultimate Edition
    ●   STS – Spring Source Toolsuite
                    –   A solid “meh”




February 15, 2012           Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   17
Plugins
    ●   Project Overlay
    ●   Augment Build
    ●   Add Common Libs
    ●   Add Capabilities




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   18
February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   19
Authentication
    ●   Do it first
    ●   Avoid mocking stuff for user session




February 15, 2012     Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   20
Spring Security Plugin
    ●   grails install-plugin spring-security-core
                                                or
    ●   BuildConfig.groovy:
    ●   compile ':spring-security-core:1.2.7.2'
    ●   grails s2-quickstart bookstore.auth
        BookstoreUser AuthRole
    ●


February 15, 2012      Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   21
BuildConfig.groovy
    ●   Ivy Dependency Management
    ●   SCM
    ●   Repository Deployment
    ●   Plugin Definitions




February 15, 2012     Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   22
Init Security
    ●   grails s2-quickstart bookstore.auth
        BookstoreUser AuthRole




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   23
Config.groovy
    ●   Tip: Break it up
    ●   Makes it easier to upgrade grails
    ●   Easier to find settings of different types
    ●   Don't forget to test it




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   24
Unit vs Integration Tests
    ●   Grails 2 unit test enhancements
    ●   Integration tests go through init sequence

    ●   create-integration-test BootStrap
    ●   test-app integration:
    ●   open test-report

February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   25
Back to Security




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   26
Lock it Down
    ●   Can use Annotation in controllers
                                             or
    ●   Centralized url-access map


        http://grails-plugins.github.com/grails-
        spring-security-core/docs/manual/


February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   27
Fixtures Plugin
    ●   grails install-plugin fixtures
    ●   Concise DSL for creating domain objects
    ●   Test data sets
    ●   Initialization data




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   28
Fixtures Shortcomings
    ●   Can't load external file
    ●   Doesn't load in production
    ●   No easy “if exists” check
    ●   Can work around all of these




February 15, 2012      Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   29
Fixtures Plugin
    ●   Fixture for roles and system user
    ●   Fixture for test/demo users
    ●   Test! Test! Test!




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   30
Why so many tests?
    ●   It's easy
    ●   Compile time checking no longer there
    ●   Do you value your sanity?




February 15, 2012     Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   31
Productivity Chart




February 15, 2012    Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   32
Grails without Tests




February 15, 2012     Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   33
Activate Fixtures
    ●   A bit about Bootstrap.groovy




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   34
App-Specific Config Settings
    ●   ConfigSlurper - a very smart properties file
    ●   Remember - can overload with other files




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   35
BuildTestData Plugin
    ●   Fills in non-essential bean fields
    ●   Keeps data in-tests
                    –   Also Integrates with Fixture plugin
    ●   As of last week, works in Unit Tests
                    –   new Book().validate() vs
                         Book.build().validate()



February 15, 2012           Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   36
Status Check
    ●   Have
                    –   DB persistence, authentication, unit and
                         integration tests, auto-initialized user and
                         data sets
    ●   Need
                    –   Audit logging, Load monitoring, remote
                         debugging, functional tests, code
                         coverage metrics, Lucene indexed
                         queries, UI niceties
February 15, 2012           Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   37
Bam!
    ●   grails install-plugin audit-logging
    ●   grails install-plugin code-coverage
    ●   grails install-plugin console
    ●   grails install-plugin codenarc
    ●   grails install-plugin geb
    ●   grails install-plugin grails-melody
    ●   grails install-plugin runtime-logging

        …Oh eff it...
    ●   Add plugin dependencies to BuildConfig
February 15, 2012           Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   38
Code Analysis
                                  and
                             Test Coverage
    ●   CodeNarc
                    –   Warning: Will not run in interactive console
    ●   Coberturra
                    –   Need to tweak include/exclude sets
    ●   Both integrate well with Jenkins

February 15, 2012           Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   39
Audit Logging
    ●   static auditable = true
    ●   Hooks into grails persistence events
    ●   Record changes down to property level
    ●   Integrates with spring security to capture
        user
    ●   Controller to view some audit info


February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   40
Audit Logging
    ●   SELECT * FROM AUDIT_LOG order by id
        desc




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   41
Monitoring with Melody




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   42
Remote Debugging
    ●   dbconsole
    ●   console
    ●   App-info
                    –   Warning: Not working with grails 2 yet




February 15, 2012           Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   43
Status Check
    ●   Have
                    –   DB persistence, authentication, unit and
                         integration tests, auto-initialized user and
                         data sets, audit logging, load monitoring,
                         remote debugging, code coverage
                         metrics
    ●   Need
                    –   functional tests, Lucene indexed queries,
                          UI niceties
February 15, 2012           Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   44
Searchable Plugin
    ●   static searchable = true
    ●   Lucene index against domain classes




February 15, 2012    Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   45
Audience Choice
    ●   Functional Testing with Geb
                                             Or
    ●   Tags and Tag Cloud




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   46
Taggable and Tag Cloud
    ●   static searchable = true
    ●   Lucene index against domain classes




February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   47
Resources
    ●   http://grails.org/
    ●   http://grails.org/plugins/
    ●   https://github.com/esword/grails-plugin-sandbox
    ●   http://groovyblogs.org/entries/recent
    ●   http://glaforge.appspot.com/article/videos-and-slides-of-groovy-gra
    ●   http://mrhaki.blogspot.com/




February 15, 2012     Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   48
Thanks!
      ●   Happy Plugging!
      ●   http://www.swordsystems.com
      ●   http://www.slideshare.net/ericsword/grails-
          goto-plugins
      ●   ericsword@gmail.com



February 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword   49

More Related Content

Viewers also liked

Achilddiesofextremepoverty 090505012736-phpapp02
Achilddiesofextremepoverty 090505012736-phpapp02Achilddiesofextremepoverty 090505012736-phpapp02
Achilddiesofextremepoverty 090505012736-phpapp02abhishek1606
 
Dehradun media
Dehradun mediaDehradun media
Dehradun media9215811330
 
Обзор работы паевых фондов 19-26 сентября 2011
Обзор работы паевых фондов 19-26 сентября 2011Обзор работы паевых фондов 19-26 сентября 2011
Обзор работы паевых фондов 19-26 сентября 2011Sergey Manvelov
 
презентация лазеров
презентация лазеровпрезентация лазеров
презентация лазеровAndreykireenkov
 
4 Things You Cannot Recover
4 Things You Cannot Recover4 Things You Cannot Recover
4 Things You Cannot RecoverVinod Kumar
 
Slide viridi et_al_20131028_0
Slide viridi et_al_20131028_0Slide viridi et_al_20131028_0
Slide viridi et_al_20131028_0Sparisoma Viridi
 
4.3 port.-buford and my room
4.3 port.-buford and my room4.3 port.-buford and my room
4.3 port.-buford and my roompbwhite
 
Universidad Central del Ecuador LennynRueda
Universidad Central del Ecuador LennynRuedaUniversidad Central del Ecuador LennynRueda
Universidad Central del Ecuador LennynRuedaLennynRueda
 
10 internet technologies educators should be informed about
10 internet technologies educators should be informed about10 internet technologies educators should be informed about
10 internet technologies educators should be informed aboutsana825
 
Inteligencias
InteligenciasInteligencias
Inteligenciaswmendieta
 
Sonipat utility p pt.
Sonipat utility p pt.Sonipat utility p pt.
Sonipat utility p pt.9215811330
 
рекомендации по презентации
рекомендации по презентациирекомендации по презентации
рекомендации по презентацииMeritSirus
 
Ghosts of gone birds the brief
Ghosts of gone birds the briefGhosts of gone birds the brief
Ghosts of gone birds the briefghostsofgonebirds
 

Viewers also liked (20)

Family2
Family2Family2
Family2
 
Achilddiesofextremepoverty 090505012736-phpapp02
Achilddiesofextremepoverty 090505012736-phpapp02Achilddiesofextremepoverty 090505012736-phpapp02
Achilddiesofextremepoverty 090505012736-phpapp02
 
Dehradun media
Dehradun mediaDehradun media
Dehradun media
 
Slide blog
Slide blogSlide blog
Slide blog
 
Обзор работы паевых фондов 19-26 сентября 2011
Обзор работы паевых фондов 19-26 сентября 2011Обзор работы паевых фондов 19-26 сентября 2011
Обзор работы паевых фондов 19-26 сентября 2011
 
презентация лазеров
презентация лазеровпрезентация лазеров
презентация лазеров
 
4 Things You Cannot Recover
4 Things You Cannot Recover4 Things You Cannot Recover
4 Things You Cannot Recover
 
Slide viridi et_al_20131028_0
Slide viridi et_al_20131028_0Slide viridi et_al_20131028_0
Slide viridi et_al_20131028_0
 
Infectious // August // 2010
Infectious // August // 2010Infectious // August // 2010
Infectious // August // 2010
 
Fleming college
Fleming collegeFleming college
Fleming college
 
4.3 port.-buford and my room
4.3 port.-buford and my room4.3 port.-buford and my room
4.3 port.-buford and my room
 
Universidad Central del Ecuador LennynRueda
Universidad Central del Ecuador LennynRuedaUniversidad Central del Ecuador LennynRueda
Universidad Central del Ecuador LennynRueda
 
10 internet technologies educators should be informed about
10 internet technologies educators should be informed about10 internet technologies educators should be informed about
10 internet technologies educators should be informed about
 
Faridabad(1)
Faridabad(1)Faridabad(1)
Faridabad(1)
 
Abstract
AbstractAbstract
Abstract
 
Cover letter
Cover letterCover letter
Cover letter
 
Inteligencias
InteligenciasInteligencias
Inteligencias
 
Sonipat utility p pt.
Sonipat utility p pt.Sonipat utility p pt.
Sonipat utility p pt.
 
рекомендации по презентации
рекомендации по презентациирекомендации по презентации
рекомендации по презентации
 
Ghosts of gone birds the brief
Ghosts of gone birds the briefGhosts of gone birds the brief
Ghosts of gone birds the brief
 

Similar to Grails Goto Plugins

GradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggugGradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggugkyon mm
 
How to improve gradle build speed
How to improve gradle build speedHow to improve gradle build speed
How to improve gradle build speedFate Chang
 
Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Zachary Klein
 
Gradle: One technology to build them all
Gradle: One technology to build them allGradle: One technology to build them all
Gradle: One technology to build them allBonitasoft
 
Continuous Deployment - The New #1 Security Feature, from BSildesLA 2012
Continuous Deployment - The New #1 Security Feature, from BSildesLA 2012Continuous Deployment - The New #1 Security Feature, from BSildesLA 2012
Continuous Deployment - The New #1 Security Feature, from BSildesLA 2012Nick Galbreath
 
Gradle build automation tool
Gradle   build automation toolGradle   build automation tool
Gradle build automation toolIoan Eugen Stan
 
Continuous integration for androids
Continuous integration for androidsContinuous integration for androids
Continuous integration for androidsKirill Zotin
 
Building an Integration Platform with Gradle/Grails - Spring 2GX 2012
Building an Integration Platform with Gradle/Grails - Spring 2GX 2012Building an Integration Platform with Gradle/Grails - Spring 2GX 2012
Building an Integration Platform with Gradle/Grails - Spring 2GX 2012bksaville
 
SpringOne 2GX 2012 - Building an Integration Platform with Grails and Gradle
SpringOne 2GX 2012 - Building an Integration Platform with Grails and GradleSpringOne 2GX 2012 - Building an Integration Platform with Grails and Gradle
SpringOne 2GX 2012 - Building an Integration Platform with Grails and GradleAdaptiveComputing
 
Gitlab meets Kubernetes
Gitlab meets KubernetesGitlab meets Kubernetes
Gitlab meets Kubernetesinovex GmbH
 
Putting the Fun into Functioning CI/CD with JHipster
Putting the Fun into Functioning CI/CD with JHipsterPutting the Fun into Functioning CI/CD with JHipster
Putting the Fun into Functioning CI/CD with JHipsterGerard Gigliotti
 
Gerrit JavaScript Plugins
Gerrit JavaScript PluginsGerrit JavaScript Plugins
Gerrit JavaScript PluginsDariusz Łuksza
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.WordCamp Harare
 
Gradle & Android Studio - Introduction
Gradle & Android Studio - IntroductionGradle & Android Studio - Introduction
Gradle & Android Studio - IntroductionKevin Pelgrims
 
Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performancegvenzl
 
GTG30: Introduction vgo
GTG30: Introduction vgoGTG30: Introduction vgo
GTG30: Introduction vgoEvan Lin
 
Jump into React-Native (Class 6)
Jump into React-Native  (Class 6)Jump into React-Native  (Class 6)
Jump into React-Native (Class 6)Waqqas Jabbar
 
What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020Noa Harel
 

Similar to Grails Goto Plugins (20)

GradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggugGradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggug
 
How to improve gradle build speed
How to improve gradle build speedHow to improve gradle build speed
How to improve gradle build speed
 
Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!
 
Gerrit Code Review
Gerrit Code ReviewGerrit Code Review
Gerrit Code Review
 
Gradle: One technology to build them all
Gradle: One technology to build them allGradle: One technology to build them all
Gradle: One technology to build them all
 
Welovejs AngularJS
Welovejs AngularJS Welovejs AngularJS
Welovejs AngularJS
 
Continuous Deployment - The New #1 Security Feature, from BSildesLA 2012
Continuous Deployment - The New #1 Security Feature, from BSildesLA 2012Continuous Deployment - The New #1 Security Feature, from BSildesLA 2012
Continuous Deployment - The New #1 Security Feature, from BSildesLA 2012
 
Gradle build automation tool
Gradle   build automation toolGradle   build automation tool
Gradle build automation tool
 
Continuous integration for androids
Continuous integration for androidsContinuous integration for androids
Continuous integration for androids
 
Building an Integration Platform with Gradle/Grails - Spring 2GX 2012
Building an Integration Platform with Gradle/Grails - Spring 2GX 2012Building an Integration Platform with Gradle/Grails - Spring 2GX 2012
Building an Integration Platform with Gradle/Grails - Spring 2GX 2012
 
SpringOne 2GX 2012 - Building an Integration Platform with Grails and Gradle
SpringOne 2GX 2012 - Building an Integration Platform with Grails and GradleSpringOne 2GX 2012 - Building an Integration Platform with Grails and Gradle
SpringOne 2GX 2012 - Building an Integration Platform with Grails and Gradle
 
Gitlab meets Kubernetes
Gitlab meets KubernetesGitlab meets Kubernetes
Gitlab meets Kubernetes
 
Putting the Fun into Functioning CI/CD with JHipster
Putting the Fun into Functioning CI/CD with JHipsterPutting the Fun into Functioning CI/CD with JHipster
Putting the Fun into Functioning CI/CD with JHipster
 
Gerrit JavaScript Plugins
Gerrit JavaScript PluginsGerrit JavaScript Plugins
Gerrit JavaScript Plugins
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
 
Gradle & Android Studio - Introduction
Gradle & Android Studio - IntroductionGradle & Android Studio - Introduction
Gradle & Android Studio - Introduction
 
Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performance
 
GTG30: Introduction vgo
GTG30: Introduction vgoGTG30: Introduction vgo
GTG30: Introduction vgo
 
Jump into React-Native (Class 6)
Jump into React-Native  (Class 6)Jump into React-Native  (Class 6)
Jump into React-Native (Class 6)
 
What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020
 

Recently uploaded

Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfrichard876048
 
APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfRbc Rbcua
 
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menzaictsugar
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCRashishs7044
 
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
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03DallasHaselhorst
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMVoces Mineras
 
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Doge Mining Website
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Kirill Klimov
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCRashishs7044
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Peter Ward
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Anamaria Contreras
 
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
 
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
 
8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCRashishs7044
 
Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFChandresh Chudasama
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024Adnet Communications
 

Recently uploaded (20)

Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdf
 
APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdf
 
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu MenzaYouth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
Youth Involvement in an Innovative Coconut Value Chain by Mwalimu Menza
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
 
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
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03
 
Memorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQMMemorándum de Entendimiento (MoU) entre Codelco y SQM
Memorándum de Entendimiento (MoU) entre Codelco y SQM
 
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
 
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 18 Noida Escorts Delhi NCR
 
Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024Flow Your Strategy at Flight Levels Day 2024
Flow Your Strategy at Flight Levels Day 2024
 
8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR8447779800, Low rate Call girls in Saket Delhi NCR
8447779800, Low rate Call girls in Saket Delhi NCR
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.
 
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
 
Corporate Profile 47Billion Information Technology
Corporate Profile 47Billion Information TechnologyCorporate Profile 47Billion Information Technology
Corporate Profile 47Billion Information Technology
 
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
 
8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR8447779800, Low rate Call girls in Rohini Delhi NCR
8447779800, Low rate Call girls in Rohini Delhi NCR
 
Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDF
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024
 

Grails Goto Plugins

  • 1. Grails Goto Plugins Eric Sword February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 1
  • 2. Who am I ● Professional geek for 17 years ● Turned management refugee in 2005 ● Now full-time dev and tech lead for SAIC ● Java '97, Groovy '07, Grails '09 ● Blog: http://www.swordsystems.com ● ericsword@gmail.com February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 2
  • 3. This Presentation ● Start from nothing - almost ● Full app in 1 hour DB Persistence Authentication Audit Logging Load Monitoring DB Monitoring Remote Debugging Unit Tests Integration Tests Functional Tests Test Data Fixtures Lucene Indexes Tags and Tag Clouds February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 3
  • 4. Get the Code ● https://github.com/esword/grails-plugin-sandbox February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 4
  • 5. All Together Now Groovy on Rails Groovy on Grails Grails February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 5
  • 6. Grails Recipe ● Take most popular Java web techs February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 6
  • 7. Apply dollop of groovy glue ● Conventions from top to bottom ● Minimal boiler plate code February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 7
  • 8. Your Choice of 745 Fixings ● February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 8
  • 9. Bake with fully integrated testing tools February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 9
  • 10. Enjoy! ● Full stack web-application framework February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 10
  • 11. Running App in 3 Lines ● grails create-app bookstore ● cd bookstore ● grails run-app February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 11
  • 12. Add MVC ● create-domain-class Author ● cre<tab> Book ● create-scaffold-controller <tab> Author ● <up arrow> Book February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 12
  • 13. Define Domain February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 13
  • 14. New in 2.0 ● Much improved interactive shell ● Better class reloading ● Web-based dbconsole February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 14
  • 15. dbconsole ● drool,drool, drool February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 15
  • 16. Get Real ● Authentication ● Test Data ● Testing ● Audit Logging ● Monitoring February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 16
  • 17. IDE Integration ● Intellij Rocks – Does require $ for Ultimate Edition ● STS – Spring Source Toolsuite – A solid “meh” February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 17
  • 18. Plugins ● Project Overlay ● Augment Build ● Add Common Libs ● Add Capabilities February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 18
  • 19. February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 19
  • 20. Authentication ● Do it first ● Avoid mocking stuff for user session February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 20
  • 21. Spring Security Plugin ● grails install-plugin spring-security-core or ● BuildConfig.groovy: ● compile ':spring-security-core:1.2.7.2' ● grails s2-quickstart bookstore.auth BookstoreUser AuthRole ● February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 21
  • 22. BuildConfig.groovy ● Ivy Dependency Management ● SCM ● Repository Deployment ● Plugin Definitions February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 22
  • 23. Init Security ● grails s2-quickstart bookstore.auth BookstoreUser AuthRole February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 23
  • 24. Config.groovy ● Tip: Break it up ● Makes it easier to upgrade grails ● Easier to find settings of different types ● Don't forget to test it February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 24
  • 25. Unit vs Integration Tests ● Grails 2 unit test enhancements ● Integration tests go through init sequence ● create-integration-test BootStrap ● test-app integration: ● open test-report February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 25
  • 26. Back to Security February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 26
  • 27. Lock it Down ● Can use Annotation in controllers or ● Centralized url-access map http://grails-plugins.github.com/grails- spring-security-core/docs/manual/ February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 27
  • 28. Fixtures Plugin ● grails install-plugin fixtures ● Concise DSL for creating domain objects ● Test data sets ● Initialization data February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 28
  • 29. Fixtures Shortcomings ● Can't load external file ● Doesn't load in production ● No easy “if exists” check ● Can work around all of these February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 29
  • 30. Fixtures Plugin ● Fixture for roles and system user ● Fixture for test/demo users ● Test! Test! Test! February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 30
  • 31. Why so many tests? ● It's easy ● Compile time checking no longer there ● Do you value your sanity? February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 31
  • 32. Productivity Chart February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 32
  • 33. Grails without Tests February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 33
  • 34. Activate Fixtures ● A bit about Bootstrap.groovy February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 34
  • 35. App-Specific Config Settings ● ConfigSlurper - a very smart properties file ● Remember - can overload with other files February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 35
  • 36. BuildTestData Plugin ● Fills in non-essential bean fields ● Keeps data in-tests – Also Integrates with Fixture plugin ● As of last week, works in Unit Tests – new Book().validate() vs Book.build().validate() February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 36
  • 37. Status Check ● Have – DB persistence, authentication, unit and integration tests, auto-initialized user and data sets ● Need – Audit logging, Load monitoring, remote debugging, functional tests, code coverage metrics, Lucene indexed queries, UI niceties February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 37
  • 38. Bam! ● grails install-plugin audit-logging ● grails install-plugin code-coverage ● grails install-plugin console ● grails install-plugin codenarc ● grails install-plugin geb ● grails install-plugin grails-melody ● grails install-plugin runtime-logging …Oh eff it... ● Add plugin dependencies to BuildConfig February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 38
  • 39. Code Analysis and Test Coverage ● CodeNarc – Warning: Will not run in interactive console ● Coberturra – Need to tweak include/exclude sets ● Both integrate well with Jenkins February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 39
  • 40. Audit Logging ● static auditable = true ● Hooks into grails persistence events ● Record changes down to property level ● Integrates with spring security to capture user ● Controller to view some audit info February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 40
  • 41. Audit Logging ● SELECT * FROM AUDIT_LOG order by id desc February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 41
  • 42. Monitoring with Melody February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 42
  • 43. Remote Debugging ● dbconsole ● console ● App-info – Warning: Not working with grails 2 yet February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 43
  • 44. Status Check ● Have – DB persistence, authentication, unit and integration tests, auto-initialized user and data sets, audit logging, load monitoring, remote debugging, code coverage metrics ● Need – functional tests, Lucene indexed queries, UI niceties February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 44
  • 45. Searchable Plugin ● static searchable = true ● Lucene index against domain classes February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 45
  • 46. Audience Choice ● Functional Testing with Geb Or ● Tags and Tag Cloud February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 46
  • 47. Taggable and Tag Cloud ● static searchable = true ● Lucene index against domain classes February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 47
  • 48. Resources ● http://grails.org/ ● http://grails.org/plugins/ ● https://github.com/esword/grails-plugin-sandbox ● http://groovyblogs.org/entries/recent ● http://glaforge.appspot.com/article/videos-and-slides-of-groovy-gra ● http://mrhaki.blogspot.com/ February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 48
  • 49. Thanks! ● Happy Plugging! ● http://www.swordsystems.com ● http://www.slideshare.net/ericsword/grails- goto-plugins ● ericsword@gmail.com February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 49