1 / 11

Introduction to

Introduction to. Prepared by : Vincent Schwarzer, Chih-Hung Hsieh . Java Enterprise Application Development. Structure. The history of Groovy. 2. What is Groovy?. Features & S trengths. 3 . Groovy Builder. 4. Groovy vs. Java OOP. 5 . Common use cases. 6. Short example.

dannon
Télécharger la présentation

Introduction to

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Preparedby: Vincent Schwarzer, Chih-Hung Hsieh Java Enterprise Application Development

  2. Structure The historyof Groovy 2. Whatis Groovy? Features & Strengths 3. Groovy Builder 4. Groovy vs. Java OOP 5. Common usecases 6. Short example Java Enterprise Application Development

  3. The historyof Groovy James Strachanstarteddeveloping Groovy in 2003 Severalversionsreleasedbetween2004 and 2006 Released final versioncalled Groovy 1.0 in 2007 Java Enterprise Application Development

  4. Whatis Groovy? • An agile anddynamiclanguageforthe JVM • Builds upon thestrengthof Java Additional power featuresinspiredbylanguages like Ruby, Python andSmallTalk • Almostzerolearningcurvefor Java Developers • Seamlesslyintegrateswith all existing Java classesandlibraries • Youcanuseitanywhereyoucanuse Java Java Enterprise Application Development

  5. Features & Strengths // oldschool Java code, but also valid Groovy code System.out.println("Hello, world!"); // idiomatic Groovy println "Hello, world!" // dynamic variable definition defname = “Peter" // GStringfeaturingstringinterpolation println "Hello, $name" // => "Hello, Peter" // staticallytyped variable String songName = "Coding in the Name of" println "Nowplaying - $songName" String multiline = """thisis a multiline string. Thereis not needtoembed newlinecharacters in it""" printlnmultiline Java Enterprise Application Development

  6. Features & Strengths // methoddefinition defgreet(name) { println "Hello, $name!" } // methodinvocation greet“Peter" greet(“Peter“) // a list defbeers = [“Becks", “Corona", “Budweiser", “Heineken"] // listaccess println"Myfavouritebeeris ${beers[1]}“ for (i in beers) { println i } // importscanappearanywhereandsupportthecreationofaliases importstaticjava.util.Calendar.getInstanceasnow importjava.sql.DateasSDate Java Enterprise Application Development

  7. Groovy Builder oneuseforbuildersisthegenerationofmarkup: Java Enterprise Application Development

  8. Groovy Builder Result: Java Enterprise Application Development

  9. Groovy vs. Java SimilarcapabilitiestoJava: Defineclasses, interfaces, enums, annotations DifferencestoJava: Classes (andinterfaces etc.) publicbydefault Methodspublicbydefault Property supportwithinclasses (auto-setters/getters) Java Enterprise Application Development

  10. Common usecases Web applicationdevelopment scripting Rapid prototyping As a proof on concept ExploratoryProgramming Test class / methodcapabilities Java Enterprise Application Development

  11. ThankYou Java Enterprise Application Development

More Related