Groovy: Efficiency Oriented ProgrammingLecture 13Master Proteomics & Bioinformatics - University of GenevaAlexandre Massel...
Agenda‣ Eclipse tip‣ Grails project organization‣ Controller & view generation‣ Loggers‣ Grails plugins‣ Groovy and beyond...
Eclipse and packages‣ Packages: organize classes into folder-like structure
Eclipse and packages‣ Packages: organize classes into folder-like structure‣ Classes into the same package: no need to imp...
Eclipse and packages‣ Packages: organize classes into folder-like structure‣ Classes into the same package: no need to imp...
Eclipse and packages‣ Packages: organize classes into folder-like structure‣ Classes into the same package: no need to imp...
Eclipse and packages‣ Packages: organize classes into folder-like structure‣ Classes into the same package: no need to imp...
Book of the day‣ “Getting Started with Grails” by Scott Davis & Jason Rudolph http://www.infoq.com/minibooks/grails-gettin...
Grails code organization‣ config grails-app/conf
Grails code organization‣ config grails-app/conf‣ web controller (actions) grails-app/controllers
Grails code organization‣ config grails-app/conf‣ web controller (actions) grails-app/controllers‣ services (database rela...
Grails code organization‣ config grails-app/conf‣ web controller (actions) grails-app/controllers‣ services (database rela...
Grails code organization‣ config grails-app/conf‣ web controller (actions) grails-app/controllers‣ services (database rela...
Grails code organization   (cont’d)
Grails code organization         (cont’d)‣ Unit tests (+mocked domains)test/unit
Grails code organization         (cont’d)‣ Unit tests (+mocked domains) test/unit‣ Integration tests test/integration
Controller & views generation‣ Controller can be implicitly generated def scaffold=true
Controller & views generation‣ Controller can be implicitly generated def scaffold=true‣ Or explicitly written
Controller & views generation‣ Controller can be implicitly generated def scaffold=true‣ Or explicitly written‣ Generate t...
Controller & views generation     (cont’d)‣ Use generated for inspiration
Controller & views generation                (cont’d)‣ Use generated for inspiration‣ Keep def scaffold = true and explici...
Controller & views generation                          (cont’d)‣ Use generated for inspiration‣ Keep def scaffold = true a...
Controller & views generation                          (cont’d)‣ Use generated for inspiration‣ Keep def scaffold = true a...
Logger: how to println message on the console
For debugging, reporting info, warnings or errors
println “loading list with $params”is not a solution:   - commenting in/out the lines   - where does this console output i...
logging: println (bad) solution‣ in MessageController.groovy def loadList = {     [SNIP]  println "loading list with $para...
logging: println (bad) solution‣ in MessageController.groovy def loadList = {     [SNIP]  println "loading list with $para...
logging: println (bad) solutionloading list with [type:sciam,messagefile:org.springframework.web.multipart.commons.Commons...
logging: println (bad) solution loading list with [type:sciam, messagefile:org.springframework.web.multipart.commons.Comm ...
logging: println (bad) solution loading list with [type:sciam, messagefile:org.springframework.web.multipart.commons.Comm ...
logging: println (bad) solution loading list with [type:sciam, messagefile:org.springframework.web.multipart.commons.Comm ...
log4j offers a convenient solution
logging: log4j solution‣ in MessageController.groovy def loadList = {     [SNIP]  log.info "loading list with $params"    ...
logging: log4j solution‣ in MessageController.groovy def loadList = {     [SNIP]  log.info "loading list with $params"    ...
logging: log4j solution                                             (cont’d)2011-05-29 22:17:31,309 [http-8080-1] INFO twi...
logging: log4j solution                                             (cont’d)2011-05-29 22:17:31,309 [http-8080-1] INFO twi...
logging: log4j solution                                             (cont’d)2011-05-29 22:17:31,309 [http-8080-1] INFO twi...
logging: log4j solution                                             (cont’d)2011-05-29 22:17:31,309 [http-8080-1] INFO twi...
logging: log4j solution                                              (cont’d) 2011-05-29 22:17:31,309 [http-8080-1] INFO t...
What is logged?How to configure?
log4j configuration
log4j configuration‣ In Config.groovylog4j = { info grails.app.controller.eop debug grails.app.service.eop.lec13.twitter.M...
Grails plugin
http://www.grails.org/plugins/        >600 plugins
Instead of coding a functionality,     check for community!
Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)
Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)
Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets...
Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets...
Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets...
Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets...
Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets...
Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets...
A couple of examples
How to install?grails tools > plugin manager
How to install?grails tools > plugin manager
=> install new controllers, domain gsp etc.
Might need configuration
Might need configuration
Enrich your web application        GrailsUI
in gsp form:<gui:datePicker id=simpleDatePicker /><gui:datePicker id=withCalendarAndTime          includeTime="false"/>
Show data chartsgoogle visualization
<gvisualization:pieCoreChart elementId="piechart" title="MyDaily Activities" width="${450}" height="${300}" columns="${myD...
How to choose a plugin?See if the plugin does what you need
How to choose a plugin?See if the plugin does what you needLook for plugin latest release date
How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gra...
How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gra...
How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gra...
How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gra...
How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gra...
Coding style
Coding style‣ It’s not only for elegance
Coding style‣ It’s not only for elegance‣ Allow clarity, readability, refactoring
Coding style‣ It’s not only for elegance‣ Allow clarity, readability, refactoring‣ Limit complexity  - max 10 lines per me...
Coding style                     (cont’d)‣ One class = one type of data
Coding style                                       (cont’d)‣ One class = one type of data‣ One method = one purpose (Singl...
Coding style                                        (cont’d)‣ One class = one type of data‣ One method = one purpose (Sing...
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use...
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use...
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use...
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use...
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use...
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use...
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use...
Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use...
Why Groovy + Grails?‣ Groovy: high productivity language
Why Groovy + Grails?‣ Groovy: high productivity language‣ Grails:  - spring (configuration)  - hibernate (database)  - web...
Why Groovy + Grails?‣ Groovy: high productivity language‣ Grails:  - spring (configuration)  - hibernate (database)  - web...
Why Groovy + Grails?‣ Groovy: high productivity language‣ Grails:  - spring (configuration)  - hibernate (database)  - web...
Why Groovy + Grails?‣ Groovy: high productivity language‣ Grails:  - spring (configuration)  - hibernate (database)  - web...
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
groovy & grails - lecture 13
Upcoming SlideShare
Loading in...5
×

groovy & grails - lecture 13

1,054

Published on

Grails project organization
Controller & view generation
Loggers
Grails plugins
Groovy and beyond
Coding re-remarks

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,054
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
24
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • info -&gt; all controllers under the eop package\ndebug only MessageService\ncontroller, service and a couple of other class have log defined by default\nin a domain, we must define it explicitely\n
  • just a framework would be nothing without community contributions\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • see url\n
  • \n
  • \n
  • often, super light\nconfiguration can offer a lot of tuning\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Freedom has a price\nsome people prefer when there is only one solution\n
  • Freedom has a price\nsome people prefer when there is only one solution\n
  • Freedom has a price\nsome people prefer when there is only one solution\n
  • Freedom has a price\nsome people prefer when there is only one solution\n
  • Freedom has a price\nsome people prefer when there is only one solution\n
  • Freedom has a price\nsome people prefer when there is only one solution\n
  • Freedom has a price\nsome people prefer when there is only one solution\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • we saw parallelization in selected chapters\n\n
  • we saw parallelization in selected chapters\n\n
  • we saw parallelization in selected chapters\n\n
  • we saw parallelization in selected chapters\n\n
  • we saw parallelization in selected chapters\n\n
  • groovy & grails - lecture 13

    1. 1. Groovy: Efficiency Oriented ProgrammingLecture 13Master Proteomics & Bioinformatics - University of GenevaAlexandre Masselot - summer 2011
    2. 2. Agenda‣ Eclipse tip‣ Grails project organization‣ Controller & view generation‣ Loggers‣ Grails plugins‣ Groovy and beyond‣ Coding re-remarks
    3. 3. Eclipse and packages‣ Packages: organize classes into folder-like structure
    4. 4. Eclipse and packages‣ Packages: organize classes into folder-like structure‣ Classes into the same package: no need to import
    5. 5. Eclipse and packages‣ Packages: organize classes into folder-like structure‣ Classes into the same package: no need to import‣ Classes into different packages: import path.to.package.ClassName import path.to.package.*
    6. 6. Eclipse and packages‣ Packages: organize classes into folder-like structure‣ Classes into the same package: no need to import‣ Classes into different packages: import path.to.package.ClassName import path.to.package.*‣ Eclipse: refactor will rename dependencies
    7. 7. Eclipse and packages‣ Packages: organize classes into folder-like structure‣ Classes into the same package: no need to import‣ Classes into different packages: import path.to.package.ClassName import path.to.package.*‣ Eclipse: refactor will rename dependencies‣ <ctrl> <shift> O : import all needed packages and removes all unnecessary packages - can be applied into the current file or on a whole tree
    8. 8. Book of the day‣ “Getting Started with Grails” by Scott Davis & Jason Rudolph http://www.infoq.com/minibooks/grails-getting-started
    9. 9. Grails code organization‣ config grails-app/conf
    10. 10. Grails code organization‣ config grails-app/conf‣ web controller (actions) grails-app/controllers
    11. 11. Grails code organization‣ config grails-app/conf‣ web controller (actions) grails-app/controllers‣ services (database related action) grails-app/services
    12. 12. Grails code organization‣ config grails-app/conf‣ web controller (actions) grails-app/controllers‣ services (database related action) grails-app/services‣ database saved objects grails-app/domain
    13. 13. Grails code organization‣ config grails-app/conf‣ web controller (actions) grails-app/controllers‣ services (database related action) grails-app/services‣ database saved objects grails-app/domain‣ all other groovy code src/groovy
    14. 14. Grails code organization (cont’d)
    15. 15. Grails code organization (cont’d)‣ Unit tests (+mocked domains)test/unit
    16. 16. Grails code organization (cont’d)‣ Unit tests (+mocked domains) test/unit‣ Integration tests test/integration
    17. 17. Controller & views generation‣ Controller can be implicitly generated def scaffold=true
    18. 18. Controller & views generation‣ Controller can be implicitly generated def scaffold=true‣ Or explicitly written
    19. 19. Controller & views generation‣ Controller can be implicitly generated def scaffold=true‣ Or explicitly written‣ Generate the scaffolded controller generate-controller eop.lec13.twitter.Person
    20. 20. Controller & views generation (cont’d)‣ Use generated for inspiration
    21. 21. Controller & views generation (cont’d)‣ Use generated for inspiration‣ Keep def scaffold = true and explicitly use only some generated methods
    22. 22. Controller & views generation (cont’d)‣ Use generated for inspiration‣ Keep def scaffold = true and explicitly use only some generated methods‣ Do not generate controllers too early in a project
    23. 23. Controller & views generation (cont’d)‣ Use generated for inspiration‣ Keep def scaffold = true and explicitly use only some generated methods‣ Do not generate controllers too early in a project‣ Same applies for generate-views
    24. 24. Logger: how to println message on the console
    25. 25. For debugging, reporting info, warnings or errors
    26. 26. println “loading list with $params”is not a solution: - commenting in/out the lines - where does this console output is written?
    27. 27. logging: println (bad) solution‣ in MessageController.groovy def loadList = { [SNIP] println "loading list with $params" [SNIP] }
    28. 28. logging: println (bad) solution‣ in MessageController.groovy def loadList = { [SNIP] println "loading list with $params" [SNIP] }‣ in MessageService.groovy def loadMessages(loader, input) { [SNIP] list.each{ [SNIP] println "inserting message to $user" [SNIP] } }
    29. 29. logging: println (bad) solutionloading list with [type:sciam,messagefile:org.springframework.web.multipart.commons.CommonsMultipartFile@10310199, action:loadList, controller:message]inserting message to Scientific Americaninserting message to Scientific Americaninserting message to Scientific Americaninserting message to Scientific Americaninserting message to Scientific Americaninserting message to Scientific Americaninserting message to Scientific American
    30. 30. logging: println (bad) solution loading list with [type:sciam, messagefile:org.springframework.web.multipart.commons.Comm onsMultipartFile@10310199, action:loadList, control ler:message] inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American‣ no filename source
    31. 31. logging: println (bad) solution loading list with [type:sciam, messagefile:org.springframework.web.multipart.commons.Comm onsMultipartFile@10310199, action:loadList, control ler:message] inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American‣ no filename source‣ no line number
    32. 32. logging: println (bad) solution loading list with [type:sciam, messagefile:org.springframework.web.multipart.commons.Comm onsMultipartFile@10310199, action:loadList, control ler:message] inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American inserting message to Scientific American‣ no filename source‣ no line number‣ no level of importance of the message
    33. 33. log4j offers a convenient solution
    34. 34. logging: log4j solution‣ in MessageController.groovy def loadList = { [SNIP] log.info "loading list with $params" [SNIP] }
    35. 35. logging: log4j solution‣ in MessageController.groovy def loadList = { [SNIP] log.info "loading list with $params" [SNIP] }‣ in MessageService.groovy def loadMessages(loader, input) { [SNIP] list.each{ [SNIP] log.debug "inserting message to $user" [SNIP] } }
    36. 36. logging: log4j solution (cont’d)2011-05-29 22:17:31,309 [http-8080-1] INFO twitter.MessageController - loadinglist with [type:sciam, messagefile:org.springframework.web.multipart.commons.CommonsMultipartFile@5f2d0b54, action:loadList,controller:message]2011-05-29 22:17:31,372 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American2011-05-29 22:17:31,464 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American2011-05-29 22:17:31,496 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American
    37. 37. logging: log4j solution (cont’d)2011-05-29 22:17:31,309 [http-8080-1] INFO twitter.MessageController - loadinglist with [type:sciam, messagefile:org.springframework.web.multipart.commons.CommonsMultipartFile@5f2d0b54, action:loadList,controller:message]2011-05-29 22:17:31,372 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American2011-05-29 22:17:31,464 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American2011-05-29 22:17:31,496 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American log level
    38. 38. logging: log4j solution (cont’d)2011-05-29 22:17:31,309 [http-8080-1] INFO twitter.MessageController - loadinglist with [type:sciam, messagefile:org.springframework.web.multipart.commons.CommonsMultipartFile@5f2d0b54, action:loadList,controller:message]2011-05-29 22:17:31,372 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American2011-05-29 22:17:31,464 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American2011-05-29 22:17:31,496 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American log level source file
    39. 39. logging: log4j solution (cont’d)2011-05-29 22:17:31,309 [http-8080-1] INFO twitter.MessageController - loadinglist with [type:sciam, messagefile:org.springframework.web.multipart.commons.CommonsMultipartFile@5f2d0b54, action:loadList,controller:message]2011-05-29 22:17:31,372 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American2011-05-29 22:17:31,464 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American2011-05-29 22:17:31,496 [http-8080-1] DEBUG twitter.MessageService - insertingmessage to Scientific American log level source file message
    40. 40. logging: log4j solution (cont’d) 2011-05-29 22:17:31,309 [http-8080-1] INFO twitter.MessageController - loading list with [type:sciam, messagefile:org.springframework.web. multipart.commons.CommonsMultipartFile@5f2d0b54, action:loadList, controller:message] 2011-05-29 22:17:31,372 [http-8080-1] DEBUG twitter.MessageService - inserting message to Scientific American 2011-05-29 22:17:31,464 [http-8080-1] DEBUG twitter.MessageService - inserting message to Scientific American 2011-05-29 22:17:31,496 [http-8080-1] DEBUG twitter.MessageService - inserting message to Scientific Americandate/time log level source file message
    41. 41. What is logged?How to configure?
    42. 42. log4j configuration
    43. 43. log4j configuration‣ In Config.groovylog4j = { info grails.app.controller.eop debug grails.app.service.eop.lec13.twitter.MessageService error org.codehaus.groovy.grails.web.servlet, // controllers org.codehaus.groovy.grails.web.pages, // GSP org.codehaus.groovy.grails.commons, // core org.codehaus.groovy.grails.plugins, // pluginsetc.
    44. 44. Grails plugin
    45. 45. http://www.grails.org/plugins/ >600 plugins
    46. 46. Instead of coding a functionality, check for community!
    47. 47. Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)
    48. 48. Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)
    49. 49. Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets (Grails UI , RichUI, GWT, DOJO)
    50. 50. Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets (Grails UI , RichUI, GWT, DOJO)‣ Search domain beans (searchable)
    51. 51. Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets (Grails UI , RichUI, GWT, DOJO)‣ Search domain beans (searchable)‣ Mail (mail)
    52. 52. Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets (Grails UI , RichUI, GWT, DOJO)‣ Search domain beans (searchable)‣ Mail (mail)‣ Excel, pdf, tsv exports (export)
    53. 53. Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets (Grails UI , RichUI, GWT, DOJO)‣ Search domain beans (searchable)‣ Mail (mail)‣ Excel, pdf, tsv exports (export)‣ Chart visualization (Google visualization)
    54. 54. Grails plugins: some examples‣ Security/authentication (spring-security, reCaptcha)‣ Javascript (jquery)‣ Sexy web widgets (Grails UI , RichUI, GWT, DOJO)‣ Search domain beans (searchable)‣ Mail (mail)‣ Excel, pdf, tsv exports (export)‣ Chart visualization (Google visualization)‣ etc. etc.
    55. 55. A couple of examples
    56. 56. How to install?grails tools > plugin manager
    57. 57. How to install?grails tools > plugin manager
    58. 58. => install new controllers, domain gsp etc.
    59. 59. Might need configuration
    60. 60. Might need configuration
    61. 61. Enrich your web application GrailsUI
    62. 62. in gsp form:<gui:datePicker id=simpleDatePicker /><gui:datePicker id=withCalendarAndTime includeTime="false"/>
    63. 63. Show data chartsgoogle visualization
    64. 64. <gvisualization:pieCoreChart elementId="piechart" title="MyDaily Activities" width="${450}" height="${300}" columns="${myDailyActivitiesColumns}" data="${myDailyActivitiesData}" /><div id="piechart"></div>
    65. 65. How to choose a plugin?See if the plugin does what you need
    66. 66. How to choose a plugin?See if the plugin does what you needLook for plugin latest release date
    67. 67. How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user grades
    68. 68. How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gradesGoogle the plugin name, to see user’s comment
    69. 69. How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gradesGoogle the plugin name, to see user’s commentLook at authors (Burt Beckwith => you can go)
    70. 70. How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gradesGoogle the plugin name, to see user’s commentLook at authors (Burt Beckwith => you can go)Look at configuration
    71. 71. How to choose a plugin?See if the plugin does what you needLook for plugin latest release dateLook for comments / user gradesGoogle the plugin name, to see user’s commentLook at authors (Burt Beckwith => you can go)Look at configurationTest the plugin in a dummy application
    72. 72. Coding style
    73. 73. Coding style‣ It’s not only for elegance
    74. 74. Coding style‣ It’s not only for elegance‣ Allow clarity, readability, refactoring
    75. 75. Coding style‣ It’s not only for elegance‣ Allow clarity, readability, refactoring‣ Limit complexity - max 10 lines per method - max 10 methods per class - max 10 classes par package
    76. 76. Coding style (cont’d)‣ One class = one type of data
    77. 77. Coding style (cont’d)‣ One class = one type of data‣ One method = one purpose (Single Level of Abstraction)
    78. 78. Coding style (cont’d)‣ One class = one type of data‣ One method = one purpose (Single Level of Abstraction)‣ Inside a method: do not explicitly modify object members of another class
    79. 79. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method
    80. 80. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use the else keyword
    81. 81. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use the else keyword‣ Wrap all primitives and strings
    82. 82. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use the else keyword‣ Wrap all primitives and strings‣ Use only one dot per line
    83. 83. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use the else keyword‣ Wrap all primitives and strings‣ Use only one dot per line‣ Dont abbreviate
    84. 84. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use the else keyword‣ Wrap all primitives and strings‣ Use only one dot per line‣ Dont abbreviate‣ Keep all entities small
    85. 85. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use the else keyword‣ Wrap all primitives and strings‣ Use only one dot per line‣ Dont abbreviate‣ Keep all entities small‣ Dont use any classes with more than two instance variables
    86. 86. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use the else keyword‣ Wrap all primitives and strings‣ Use only one dot per line‣ Dont abbreviate‣ Keep all entities small‣ Dont use any classes with more than two instance variables‣ Use first-class collections
    87. 87. Pushing coding style to the limit“Object Calisthenics” by Jeff Bay‣ Use only one level of indentation per method‣ Dont use the else keyword‣ Wrap all primitives and strings‣ Use only one dot per line‣ Dont abbreviate‣ Keep all entities small‣ Dont use any classes with more than two instance variables‣ Use first-class collections‣ Dont use any getters/setters/properties
    88. 88. Why Groovy + Grails?‣ Groovy: high productivity language
    89. 89. Why Groovy + Grails?‣ Groovy: high productivity language‣ Grails: - spring (configuration) - hibernate (database) - web - plugins
    90. 90. Why Groovy + Grails?‣ Groovy: high productivity language‣ Grails: - spring (configuration) - hibernate (database) - web - plugins‣ Java integration
    91. 91. Why Groovy + Grails?‣ Groovy: high productivity language‣ Grails: - spring (configuration) - hibernate (database) - web - plugins‣ Java integration‣ Run on Java Virtual Machine
    92. 92. Why Groovy + Grails?‣ Groovy: high productivity language‣ Grails: - spring (configuration) - hibernate (database) - web - plugins‣ Java integration‣ Run on Java Virtual Machine‣ JVM: a whole biotope of languages
    1. A particular slide catching your eye?

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

    ×