Grails Goto Plugins
Upcoming SlideShare
Loading in...5
×
 

Grails Goto Plugins

on

  • 1,782 views

 

Statistics

Views

Total Views
1,782
Views on SlideShare
1,782
Embed Views
0

Actions

Likes
2
Downloads
31
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Grails Goto Plugins Grails Goto Plugins Presentation Transcript

    • Grails Goto Plugins Eric SwordFebruary 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.comFebruary 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 CloudsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 3
    • Get the Code ● https://github.com/esword/grails-plugin-sandboxFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 4
    • All Together Now Groovy on Rails Groovy on Grails GrailsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 5
    • Grails Recipe ● Take most popular Java web techsFebruary 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 codeFebruary 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 toolsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 9
    • Enjoy! ● Full stack web-application frameworkFebruary 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-appFebruary 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> BookFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 12
    • Define DomainFebruary 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 dbconsoleFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 14
    • dbconsole ● drool,drool, droolFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 15
    • Get Real ● Authentication ● Test Data ● Testing ● Audit Logging ● MonitoringFebruary 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 CapabilitiesFebruary 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 sessionFebruary 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 DefinitionsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 22
    • Init Security ● grails s2-quickstart bookstore.auth BookstoreUser AuthRoleFebruary 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 ● Dont forget to test itFebruary 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-reportFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 25
    • Back to SecurityFebruary 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 dataFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 28
    • Fixtures Shortcomings ● Cant load external file ● Doesnt load in production ● No easy “if exists” check ● Can work around all of theseFebruary 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? ● Its 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 ChartFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 32
    • Grails without TestsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 33
    • Activate Fixtures ● A bit about Bootstrap.groovyFebruary 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 filesFebruary 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 nicetiesFebruary 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 BuildConfigFebruary 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 JenkinsFebruary 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 infoFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 40
    • Audit Logging ● SELECT * FROM AUDIT_LOG order by id descFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 41
    • Monitoring with MelodyFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 42
    • Remote Debugging ● dbconsole ● console ● App-info – Warning: Not working with grails 2 yetFebruary 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 nicetiesFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 44
    • Searchable Plugin ● static searchable = true ● Lucene index against domain classesFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 45
    • Audience Choice ● Functional Testing with Geb Or ● Tags and Tag CloudFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 46
    • Taggable and Tag Cloud ● static searchable = true ● Lucene index against domain classesFebruary 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.comFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 49