tdc2016sp - groovy como você nunca viu
TRANSCRIPT
![Page 1: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/1.jpg)
COMO VOCÊ NUNCA VIU
![Page 2: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/2.jpg)
/DEV/FELIPEMAMUD
![Page 3: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/3.jpg)
Disclaimer
![Page 4: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/4.jpg)
It's Groovy
● Groovy is object-oriented dynamic language by default, but…
… can be optionally typed;
… can be static type checking with @TypeChecked;
● dynamic != interpreted;
● static compilation with @CompileStatic;
● Groovy compiles down to JVM bytecode;
● Script vs Classes;
![Page 5: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/5.jpg)
A little bit of history
2003 2007 2008
1.0
2011 2012
2.0
2014 20152005
![Page 6: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/6.jpg)
Compilation phases
1. Initialization (read source files and config compiler)
2. Parsing (text → concrete syntax tree; Antlr2)
3. Conversion (CST → AST) @Grab
4. Semantic Analysis (resolve classes, consistency and grammar) @Lazy @Builder @Field @Log
5. Canonicalization (AST finalize and last chance to use AST) @Delegate @ToString @Immutable
6. Instruction Selection (instruction set for bytecode / type checking) @CompileStatic @TypeChecked
7. Class Generation (create bytecode in memory, AST → bytecode)
8. Output (binary output .class to file system)
9. Finalization (perform cleanup tasks, unused today!)
![Page 7: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/7.jpg)
Awesome!
● Optional (Typing, Semicolons, Parentheses, public & return keyword);
● Native syntax constructs (Closures, Lists, Maps, Regex, Ranges)
● Boilerplate mode off; (String, BigDecimal, Null, Truth, Switch)
● Java Interoperability & integration;
● Groovy Development Kit enhancements (GDK);
● DSL easy mode on;
● Builders;
● AST Transformations;
![Page 8: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/8.jpg)
Groovy’s nature
programming language…
as type safe as you want itstatic type checking
as fast as you needstatic compilation
as functional as you make itclosures, immutable, etc…
![Page 9: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/9.jpg)
Ecosystem
![Page 10: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/10.jpg)
References
● Groovy documentationhttp://groovy-lang.org/documentation.html
● Guillaume Laforge's Bloghttp://glaforge.appspot.com
● Cédric Champeau's Bloghttp://melix.github.io/blog
● Groovy in Action, 2nd Editionhttps://www.manning.com/books/groovy-in-action-second-edition
![Page 11: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/11.jpg)
JOIN US!FRIENDSTECHDAY.COM
SHARE, LEARN E CONTRIBUTE!
![Page 12: TDC2016SP - Groovy como você nunca viu](https://reader034.vdocuments.com.br/reader034/viewer/2022052418/58cfd5251a28ab13238b4c9b/html5/thumbnails/12.jpg)
Felipe Mamud@ftmamud
THANK YOU!