Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

A Walkthrough of Groovy AST Transformations

1,930 views

Published on

Published in: Technology, Education

A Walkthrough of Groovy AST Transformations

  1. 1. A Walkthrough of GroovyAST Transformations
  2. 2. About the speaker๏  Java developer since the beginning๏  True believer in Open Source๏  Groovy committer since 2007๏  Project lead of the Griffon framework๏  Currently working forwww.canoo.com 2
  3. 3. What are AST Transformations?๏  Essentially byte code generation๏  They enable compile-time metaprogramming๏  Groovy has two types of AST transformations: global and localwww.canoo.com 3
  4. 4. Available in Groovy 1.7www.canoo.com
  5. 5. @Delegatewww.canoo.com 5
  6. 6. @Singletonwww.canoo.com 6
  7. 7. @Immutablewww.canoo.com 7
  8. 8. @Categorywww.canoo.com 8
  9. 9. @Mixinwww.canoo.com 9
  10. 10. @Grabwww.canoo.com 10
  11. 11. @Synchronizedwww.canoo.com 11
  12. 12. @Lazywww.canoo.com 12
  13. 13. @Newifywww.canoo.com 13
  14. 14. @Bindable (Vetoable)www.canoo.com 14
  15. 15. Available in Groovy 1.8www.canoo.com
  16. 16. @Log (@Commons @Log4j @Slf4j)www.canoo.com 16
  17. 17. @InheritConstructorswww.canoo.com 17
  18. 18. @ToStringwww.canoo.com 18
  19. 19. @EqualsAndHashCodewww.canoo.com 19
  20. 20. @TupleConstructorwww.canoo.com 20
  21. 21. @Canonical๏  Merges @ToString, @EqualsAndHashCode and @TupleConstructor๏  Allows specific tweaks per annotationwww.canoo.com 21
  22. 22. @IndexedPropertywww.canoo.com 22
  23. 23. And there are many more…๏  @AutoClone๏  @AutoExternalize๏  @ConditionalInterrupt @TimedInterrupt @ThreadInterrupt๏  @PackageScope๏  @WithReadLock @WithWriteLock๏  @Fieldwww.canoo.com 23
  24. 24. Found in other projects๏  . ‣  @Entity๏  . ‣  @EventPublisher ‣  @Listener ‣  @Entity ‣  @Scaffold๏  Modules ‣  @Scalify ‣  @Bytecode๏  Groovy++ ‣  @Typedwww.canoo.com 24
  25. 25. http://people.canoo.com/sharewww.canoo.com 25
  26. 26. Thank you!twitter: @aalmiray

×