Groovy Intro

  • View
    616

  • Download
    3

Embed Size (px)

Transcript

  • 1. Groovy: Fly Beyond Java Copyright 2001-2008 Infor Global Solutions

2. Agenda

  • Why Groovy Appears
  • How Groovy Rocks

3.

4. CEO = 5. 6. Copyright 2001-2006 Infor Global Solutions 7. Copyright 2001-2006 Infor Global Solutions Groovy Groovy Java Java Ruby Groovy 8. Copyright 2001-2006 Infor Global Solutions Groovy 9. Copyright 2001-2006 Infor Global Solutions Java: String name = abc; Groovy: String name = abc defname name = abc 10. Copyright 2001-2006 Infor Global Solutions class Person { private String name; public Person(String name) {this.name = name;} public String getName() {return name;} } Person person = new person(ocean) return person.getName(); class Person { String name; } Person person = new Person(name:ocean) return person .name 11. Copyright 2001-2006 Infor Global Solutions firstName = ocean lastName = dong message = My name is$ firstName$ lastName person = new Person() person.setName(ocean) message = My name is${ person.name } Message = Hi, My name is ${person.name} def pattern =/ hello.* / 12. Copyright 2001-2006 Infor Global Solutions List: def aList = [1, 2, 3] def aList = [10, abc, new Date()] Map: def aMap = [a:1, b:2] Range: def aRange = a..z def numbers = 0..