compile time metaprogramming with groovy

7
Compile Time Metaprogramming With Groovy Jeff Scott Brown @jeffscottbrown [email protected]

Upload: spring-by-pivotal

Post on 12-Apr-2017

273 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Compile Time Metaprogramming with Groovy

Compile Time Metaprogramming

With GroovyJeff Scott Brown @jeffscottbrown

[email protected]

Page 2: Compile Time Metaprogramming with Groovy

More at ociweb.com/grails

Page 3: Compile Time Metaprogramming with Groovy

Copyright (c) 2015 Object Computing, Inc. All rights reserved.

WE ARE HIRING!

Groovy And Grails Project Work Grails 2 -> 3 Plugin Migrations Grails Plugin Development Expanding GORM’s Reach New Application Profiles Grails Core Development

[email protected]

Page 4: Compile Time Metaprogramming with Groovy

• What Is Metaprogramming – programs that modify programs

• Groovy Supports Runtime Metaprogramming – MOP – MetaClass – etc...

• Groovy Supports Compile Time Metaprogramming – AST Transformations

Metaprogramming

Copyright (c) 2015 Object Computing, Inc. All rights reserved.

Page 5: Compile Time Metaprogramming with Groovy

AST Transformations In Grails • Grails Applies Many Compile Time Transformations To

Application Artifacts – controller methods – controller exception handling – command objects – bindable – GORM

Copyright (c) 2015 Object Computing, Inc. All rights reserved.

Page 6: Compile Time Metaprogramming with Groovy

Compile Time Transformations • Groovy Provides A Bunch Of Transformations

– @Delegate – @Immutable – @PackageScope – @Singleton – etc…

Copyright (c) 2015 Object Computing, Inc. All rights reserved.

Page 7: Compile Time Metaprogramming with Groovy

Q&A

Jeff Scott Brown @jeffscottbrown

[email protected]