Groovy Programing Language <ul><li>Why this topic? </li><ul><li>Agile web development with Grails
Apply better practice to our groovy templates </li></ul><li>After this topic? </li><ul><li>Web development with Grails
Develop Grails with Flex and deploy on Google App Engine or Spring Source Cloud </li></ul></ul>
Groovy Programming Language <ul><li>What is Groovy?
Let's play with Groovy
Some basic differences from Java
Some new operators
Anything in Java but not in Groovy
Expert Groovy
Best practices </li></ul>
Upcoming SlideShare
Loading in...5
×

eXo EC - Groovy Programming Language

1,437

Published on

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

  • Be the first to like this

No Downloads
Views
Total Views
1,437
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

eXo EC - Groovy Programming Language

  1. 1. Groovy Programing Language <ul><li>Why this topic? </li><ul><li>Agile web development with Grails
  2. 2. Apply better practice to our groovy templates </li></ul><li>After this topic? </li><ul><li>Web development with Grails
  3. 3. Develop Grails with Flex and deploy on Google App Engine or Spring Source Cloud </li></ul></ul>
  4. 4. Groovy Programming Language <ul><li>What is Groovy?
  5. 5. Let's play with Groovy
  6. 6. Some basic differences from Java
  7. 7. Some new operators
  8. 8. Anything in Java but not in Groovy
  9. 9. Expert Groovy
  10. 10. Best practices </li></ul>
  11. 11. What is Groovy? <ul><li>In 1995, Java changed the world
  12. 12. Now Java bloats with too many frameworks, libs... -> many organizations have to consider Ruby, LAMP, .NET for more productive and agile at lower costs
  13. 13. Groovy appeared in 2003 – promising more complete and dynamic language for JVM instead of Ruby, Python, or JavaScript implementation for JVM. </li></ul>
  14. 14. Let's play with Groovy <ul><li>Our famous “Hello World” in Java
  15. 15. Switch “Hello World” Java to Groovy </li></ul>
  16. 16. Differences from Java <ul><li>Fewer imports: </li><ul><li>java.io
  17. 17. java.math
  18. 18. java.net
  19. 19. java.util
  20. 20. groovy.lang
  21. 21. groovy.util </li></ul></ul>
  22. 22. Differences from Java <ul><li>The truth
  23. 23. Java: if (mySet == null || mySet.isEmpty()) {
  24. 24. ...
  25. 25. }
  26. 26. Groovy:
  27. 27. if (!mySet) {
  28. 28. ...
  29. 29. } </li></ul>
  30. 30. New Operators <ul><li>?. (NULL-SAFE OBJECT NAVIGATION)
  31. 31. ?: (ELVIS!)
  32. 32. *. (THE SPREAD-DOT OPERATOR)
  33. 33. <=> (COMPARISONS WITH A SPACESHIP)
  34. 34. ${} (GROOVY STRINGS)
  35. 35. [] (ARRAY-STYLE NOTATION FOR LISTS AND MAPS) </li></ul>
  36. 36. <ul>In Java but not in Groovy </ul><ul><li>Java “FOR” loop
  37. 37. No “DO...WHILE”
  38. 38. Inner and anonymous classes: Not fully supported </li></ul>
  39. 39. <ul>Expert Groovy </ul><ul><li>Closures : single-method anonymous classes
  40. 40. [ &quot;apple&quot;, &quot;pear&quot;, &quot;cherry&quot; ].each { println it }
  41. 41. Duck Typing : Applied to dynamic languages, it means that if an object has a particular property or method signature, then it doesn’t matter what type the object is, you can still call that method or access that property. This is only possible in dynamic languages because properties and methods are resolved at runtime. </li></ul>
  42. 42. Best Practices <ul><li>Use idiomatic Groovy
  43. 43. Experiment
  44. 44. Use methods where appropriate
  45. 45. Use explicit types in method signatures </li></ul>
  1. A particular slide catching your eye?

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

×