0
Grails Goto Plugins                               Eric SwordFebruary 15, 2012    Grails Goto Plugins ­ DC GUG ­ Copyright ...
Who am I●    Professional geek for 17 years●    Turned management refugee in 2005●    Now full-time dev and tech lead for ...
This Presentation ●   Start from nothing - almost ●   Full app in 1 hour     DB Persistence              Authentication   ...
Get the Code ●   https://github.com/esword/grails-plugin-sandboxFebruary 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyrig...
All Together Now                Groovy on Rails                Groovy on Grails                    GrailsFebruary 15, 2012...
Grails Recipe    ●   Take most popular Java web techsFebruary 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eri...
●   Apply dollop of groovy glue     ●   Conventions from top to bottom     ●   Minimal boiler plate codeFebruary 15, 2012 ...
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 201...
Enjoy!    ●   Full stack web-application frameworkFebruary 15, 2012   Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric S...
Running App in 3 Lines    ●   grails create-app bookstore    ●   cd bookstore    ●   grails run-appFebruary 15, 2012   Gra...
Add MVC    ●   create-domain-class Author    ●   cre<tab> Book    ●   create-scaffold-controller <tab> Author    ●   <up a...
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, 201...
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   G...
IDE Integration    ●   Intellij Rocks                    –   Does require $ for Ultimate Edition    ●   STS – Spring Sourc...
Plugins    ●   Project Overlay    ●   Augment Build    ●   Add Common Libs    ●   Add CapabilitiesFebruary 15, 2012   Grai...
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 ­ D...
Spring Security Plugin    ●   grails install-plugin spring-security-core                                                or...
BuildConfig.groovy    ●   Ivy Dependency Management    ●   SCM    ●   Repository Deployment    ●   Plugin DefinitionsFebru...
Init Security    ●   grails s2-quickstart bookstore.auth        BookstoreUser AuthRoleFebruary 15, 2012   Grails Goto Plug...
Config.groovy    ●   Tip: Break it up    ●   Makes it easier to upgrade grails    ●   Easier to find settings of different...
Unit vs Integration Tests    ●   Grails 2 unit test enhancements    ●   Integration tests go through init sequence    ●   ...
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 ur...
Fixtures Plugin    ●   grails install-plugin fixtures    ●   Concise DSL for creating domain objects    ●   Test data sets...
Fixtures Shortcomings    ●   Cant load external file    ●   Doesnt load in production    ●   No easy “if exists” check    ...
Fixtures Plugin    ●   Fixture for roles and system user    ●   Fixture for test/demo users    ●   Test! Test! Test!Februa...
Why so many tests?    ●   Its easy    ●   Compile time checking no longer there    ●   Do you value your sanity?February 1...
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 Eri...
App-Specific Config Settings    ●   ConfigSlurper - a very smart properties file    ●   Remember - can overload with other...
BuildTestData Plugin    ●   Fills in non-essential bean fields    ●   Keeps data in-tests                    –   Also Inte...
Status Check    ●   Have                    –   DB persistence, authentication, unit and                         integrati...
Bam!    ●   grails install-plugin audit-logging    ●   grails install-plugin code-coverage    ●   grails install-plugin co...
Code Analysis                                  and                             Test Coverage    ●   CodeNarc              ...
Audit Logging    ●   static auditable = true    ●   Hooks into grails persistence events    ●   Record changes down to pro...
Audit Logging    ●   SELECT * FROM AUDIT_LOG order by id        descFebruary 15, 2012   Grails Goto Plugins ­ DC GUG ­ Cop...
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...
Status Check    ●   Have                    –   DB persistence, authentication, unit and                         integrati...
Searchable Plugin    ●   static searchable = true    ●   Lucene index against domain classesFebruary 15, 2012    Grails Go...
Audience Choice    ●   Functional Testing with Geb                                             Or    ●   Tags and Tag Clou...
Taggable and Tag Cloud    ●   static searchable = true    ●   Lucene index against domain classesFebruary 15, 2012   Grail...
Resources    ●   http://grails.org/    ●   http://grails.org/plugins/    ●   https://github.com/esword/grails-plugin-sandb...
Thanks!      ●   Happy Plugging!      ●   http://www.swordsystems.com      ●   http://www.slideshare.net/ericsword/grails-...
Upcoming SlideShare
Loading in...5
×

Grails Goto Plugins

1,645

Published on

Published in: Business, Technology, Art & Photos
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,645
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
35
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Grails Goto Plugins"

  1. 1. Grails Goto Plugins Eric SwordFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 1
  2. 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.comFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 2
  3. 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 CloudsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 3
  4. 4. Get the Code ● https://github.com/esword/grails-plugin-sandboxFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 4
  5. 5. All Together Now Groovy on Rails Groovy on Grails GrailsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 5
  6. 6. Grails Recipe ● Take most popular Java web techsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 6
  7. 7. ● 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
  8. 8. Your Choice of 745 Fixings ●February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 8
  9. 9. Bake with fully integrated testing toolsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 9
  10. 10. Enjoy! ● Full stack web-application frameworkFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 10
  11. 11. 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
  12. 12. 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
  13. 13. Define DomainFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 13
  14. 14. 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
  15. 15. dbconsole ● drool,drool, droolFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 15
  16. 16. Get Real ● Authentication ● Test Data ● Testing ● Audit Logging ● MonitoringFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 16
  17. 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. 18. Plugins ● Project Overlay ● Augment Build ● Add Common Libs ● Add CapabilitiesFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 18
  19. 19. February 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 19
  20. 20. Authentication ● Do it first ● Avoid mocking stuff for user sessionFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 20
  21. 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. 22. BuildConfig.groovy ● Ivy Dependency Management ● SCM ● Repository Deployment ● Plugin DefinitionsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 22
  23. 23. Init Security ● grails s2-quickstart bookstore.auth BookstoreUser AuthRoleFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 23
  24. 24. 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
  25. 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-reportFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 25
  26. 26. Back to SecurityFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 26
  27. 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. 28. 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
  29. 29. 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
  30. 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. 31. 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
  32. 32. Productivity ChartFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 32
  33. 33. Grails without TestsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 33
  34. 34. Activate Fixtures ● A bit about Bootstrap.groovyFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 34
  35. 35. 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
  36. 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. 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 nicetiesFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 37
  38. 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 BuildConfigFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 38
  39. 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 JenkinsFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 39
  40. 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 infoFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 40
  41. 41. Audit Logging ● SELECT * FROM AUDIT_LOG order by id descFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 41
  42. 42. Monitoring with MelodyFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 42
  43. 43. 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
  44. 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 nicetiesFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 44
  45. 45. Searchable Plugin ● static searchable = true ● Lucene index against domain classesFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 45
  46. 46. Audience Choice ● Functional Testing with Geb Or ● Tags and Tag CloudFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 46
  47. 47. Taggable and Tag Cloud ● static searchable = true ● Lucene index against domain classesFebruary 15, 2012 Grails Goto Plugins ­ DC GUG ­ Copyright 2012 Eric Sword 47
  48. 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. 49. 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×