eXo EC - Groovy Programming Language
Upcoming SlideShare
Loading in...5
×
 

eXo EC - Groovy Programming Language

on

  • 2,081 views

 

Statistics

Views

Total Views
2,081
Slideshare-icon Views on SlideShare
2,080
Embed Views
1

Actions

Likes
0
Downloads
8
Comments
0

1 Embed 1

http://facebook.slideshare.com 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

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

    eXo EC - Groovy Programming Language eXo EC - Groovy Programming Language Presentation Transcript

    • Groovy Programing Language
      • Why this topic?
        • Agile web development with Grails
        • Apply better practice to our groovy templates
      • After this topic?
        • Web development with Grails
        • Develop Grails with Flex and deploy on Google App Engine or Spring Source Cloud
    • Groovy Programming Language
      • 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
    • What is Groovy?
      • In 1995, Java changed the world
      • Now Java bloats with too many frameworks, libs... -> many organizations have to consider Ruby, LAMP, .NET for more productive and agile at lower costs
      • Groovy appeared in 2003 – promising more complete and dynamic language for JVM instead of Ruby, Python, or JavaScript implementation for JVM.
    • Let's play with Groovy
      • Our famous “Hello World” in Java
      • Switch “Hello World” Java to Groovy
    • Differences from Java
      • Fewer imports:
        • java.io
        • java.math
        • java.net
        • java.util
        • groovy.lang
        • groovy.util
    • Differences from Java
      • The truth
      • Java: if (mySet == null || mySet.isEmpty()) {
      • ...
      • }
      • Groovy:
      • if (!mySet) {
      • ...
      • }
    • New Operators
      • ?. (NULL-SAFE OBJECT NAVIGATION)
      • ?: (ELVIS!)
      • *. (THE SPREAD-DOT OPERATOR)
      • <=> (COMPARISONS WITH A SPACESHIP)
      • ${} (GROOVY STRINGS)
      • [] (ARRAY-STYLE NOTATION FOR LISTS AND MAPS)
      • In Java but not in Groovy
      • Java “FOR” loop
      • No “DO...WHILE”
      • Inner and anonymous classes: Not fully supported
      • Expert Groovy
      • Closures : single-method anonymous classes
      • [ &quot;apple&quot;, &quot;pear&quot;, &quot;cherry&quot; ].each { println it }
      • 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.
    • Best Practices
      • Use idiomatic Groovy
      • Experiment
      • Use methods where appropriate
      • Use explicit types in method signatures