SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
What’s new in Groovy & Grails Support?
DSL Support in Groovy-Eclipse
Andrew Eisenberg, SpringSource Tools Team




                                            © 2011 SpringSource, A division of VMware. All rights reserved
What’s new in Groovy & Grails Support?

Part 1




                                 © 2011 SpringSource, A division of VMware. All rights reserved
New Groovy-Eclipse Support in 2.5.0

  DSL Descriptors (discussed later)
  Groovy 1.8
  Parameter guessing content assist
  Script outline view
  Distinguish read vs. write access in search
  Conditional breakpoints in Groovy files (STS only)




                                                        3
New Grails tooling support in STS 2.7.0.M1

  Service field content assist
  Groovy search results in GSPs




                                             4
Gradle support in STS

Part 1.5




                        © 2011 SpringSource, A division of VMware. All rights reserved
First cut at Gradle support now available in STS

  Demoed this morning in the Gradle talk
  Yay!




                                                   6
DSL Support in Groovy-Eclipse

Part 2




                                © 2011 SpringSource, A division of VMware. All rights reserved
The Problem




              8
A DSL for distance calculations




                  3.m + 2.yd + 2.mi - 1.km
       In the Groovy editor:




                                  Uh oh!


      Can we do better???
                                             9
The Solution:
DSL Descriptors (DSLDs)




                          10
DSL Descriptors

  Teach the IDE about DSLs through scripting




                               CONFIDENTIAL     11
DSL Descriptors

  In English:
  •  “Any subtype of Number should have the following properties: m, yd, mi, km”
  In DSLD:
  •  “Any subtype of Number”:
      currentType( subType( Number ) )!
  •  “…the following properties…”:
       [ “m”, “yd”, “cm”, “mi”, “km” ].each {!
            property name:it, type:"Distance”!
       }!




               3.m + 2.yd + 2.mi - 1.km

                                                                                   12
Let’s see that

  Ex 1: Distances




                     13
Anatomy of a DSLD file




                         14
DSLD and the Inferencing Engine
  Hooks into Groovy-Eclipse’s type inferencing engine
 •  Visit each expression AST node
 •  Determine type using previous expression
 •  Move to next expression
  DSLD operates on Groovy AST Expression nodes
 •  Exposes Groovy AST nodes and uses Groovy API
  In the background, while typing (reconciling)
              org.codehaus.groovy.ast.expr.Expression!




                                                         15
Pointcuts and Contribution blocks
  Pointcuts:
  •  Where to do it.
  •  What is the current expression?
  •  Declaring type?                             class Other {!
  •  Enclosing class?                               def x!
                                                 }!
  Contribution blocks:                          class Foo {!
  •  What to do                                     def method() {!
  •  “Add” method                                      new Other().x!
  •  “Add” property                                 }!
                                                 }!
       •  (not at runtime, in the editor only)




                                                                        16
What goes in a Contribution Block?

  property : “adds” a property                  (…).accept {!
 •  arguments                                       property name: “myName”!
   •  name: “blarb”                                 method name: “getMyName”!
                                                 }!
   •  type: “java.lang.String”
   •  declaringType :”com.foo.Frumble”
   •  isStatic: false
   •  doc: “Some html”
   •  provider: “My DSL”
  method : “adds” a method
 •  all arguments above, and
   •  params: [firstName:“java.lang.String”, lastName:“java.lang.String”]
   •  useNamedArgs: true


  name is required, others optional

                                                                            17
Pointcuts

  currentType() : Matches on the current declaring type
  enclosingClass() : Matches on the enclosing class
  currentType(“com.bar.Foo”)
  methods(“run”)
  annotatedBy(“org.junit.runner.RunWith”)
  enclosingClass(
  annotatedBy(“org.junit.runner.RunWith”) ) &
 currentType(methods(“run”) )




                                                           18
Where does this pointcut match? What does it add?
(enclosingClass(annotatedBy(“org.junit.runner.RunWith”)) & 

currentType(methods(“run”))).accept { property name:”blarb” }!

                                       Looking for an expression that:
@RunWith(Sumthin) !
class Foo {!
   def someTest() {!                         enclosed by
                                             @RunWith
      print “Hello”!
      def x = new MyRunner()!
      x.blarb!                                          has run method
   }!
                                                blarb
}!
 class MyRunner { def run() {…} }!




                                                                    19
Wait…isn’t this Aspect-Oriented Programming?

  Pointcut
  •  Intentionally borrowed from AOP
  AspectJ: pointcuts and advice
  •  operates on Java instructions at runtime
                                                               class Foo {!
  DSLD: pointcuts and contribution blocks                       def x = {!
  •  operates on AST                                               def i = 0!
   org.codehaus.groovy.ast.expr.*!
  Join Point Model                                                      i++!
                                                                    }!
  •  Join points (e.g., instructions, expressions)
                                                               }!
  •  Mechanism for quantifying join points (e.g., pointcuts)
  •  Means of affect at a join point (e.g., advice,
   contribution blocks)




                                                                                20
Other things to help with DSLDs




                                  21
New DSLD Wizard

  File  New  Groovy DSL Descriptor




                                        22
DSLD Preferences Page




                        23
Groovy Event Console

  Keep this open while implementing DSLDs:
 •  Shows exceptions
 •  Pointcuts
 •  Matches




  Find the Console here:




                                              24
Groovy AST Viewer

  Exploration of AST of current Groovy file




                                               25
Examples




           26
Basic Script
Ex 2: Using the DSLD wizard




                              27
Meta DSL
Ex 3: DSLD script for editing DSLDs




                                      28
AST Transforms
Ex 3: Standard AST Transforms




                                29
SwingBuilder
Ex 4: Long script, but simple to understand




                                              30
Grails Constraints DSL
Ex 5: encapsulate Grails domain knowledge in a script




                                                        31
Criteria Queries
Ex 6: simple script, large effect




                                    32
Griffon
Ex 7: from last night




                        33
What’s next?




               34
DSLD is not complete

  Guided by user feedback
  Collaboration with library developers
 •  Grails, Gaelyk, Griffon, etc.
  Release standard DSLDs (AST Transforms, Builders, etc.)
 •  With Groovy-Eclipse?
 •  With Groovy core?
  More pointcuts
 •  What do users need that isn’t implemented?
 •  regex(), instanceof(), superType(), enclosingEnum(), etc.
  What about IntelliJ’s GDSL?




                                                                35
Thanks!

  More information:
  •  Google: groovy eclipse dsld
  Full documentation on Codehaus.org:
  •  http://docs.codehaus.org/display/GROOVY/DSL+Descriptors+for+Groovy-Eclipse
  Install from update site:
  •  http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/
  Mailing list:
  •  eclipse-plugin-users@codehaus.org
  Or chat with me whenever




                                                                                  36

Contenu connexe

Tendances

Tendances (14)

The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.4 book - Part 15 of 185The Ring programming language version 1.5.4 book - Part 15 of 185
The Ring programming language version 1.5.4 book - Part 15 of 185
 
01 cocos2d past, present and future
01   cocos2d past, present and future01   cocos2d past, present and future
01 cocos2d past, present and future
 
Scalable Open Source
Scalable Open SourceScalable Open Source
Scalable Open Source
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in Scala
 
Beyond JVM - YOW Melbourne 2013
Beyond JVM - YOW Melbourne 2013Beyond JVM - YOW Melbourne 2013
Beyond JVM - YOW Melbourne 2013
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
The State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
 
A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9A new execution model for Nashorn in Java 9
A new execution model for Nashorn in Java 9
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
 
Lagergren jvmls-2014-final
Lagergren jvmls-2014-finalLagergren jvmls-2014-final
Lagergren jvmls-2014-final
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013
 
Microsoft, java and you!
Microsoft, java and you!Microsoft, java and you!
Microsoft, java and you!
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
What Drove Wordnik Non-Relational?
What Drove Wordnik Non-Relational?What Drove Wordnik Non-Relational?
What Drove Wordnik Non-Relational?
 

Similaire à Better DSL Support for Groovy-Eclipse

Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)
Vitaly Baum
 

Similaire à Better DSL Support for Groovy-Eclipse (20)

GR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
GR8Conf 2009: Practical Groovy DSL by Guillaume LaforgeGR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
GR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
 
Exciting JavaScript - Part II
Exciting JavaScript - Part IIExciting JavaScript - Part II
Exciting JavaScript - Part II
 
Dojo for programmers (TXJS 2010)
Dojo for programmers (TXJS 2010)Dojo for programmers (TXJS 2010)
Dojo for programmers (TXJS 2010)
 
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
Stefan Richter - Writing simple, readable and robust code: Examples in Java, ...
 
Dojo GFX workshop slides
Dojo GFX workshop slidesDojo GFX workshop slides
Dojo GFX workshop slides
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
 
Pulsar
PulsarPulsar
Pulsar
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovy
 
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
Why Extension Programmers Should Stop Worrying About Parsing and Start Thinki...
 
Triton and symbolic execution on gdb
Triton and symbolic execution on gdbTriton and symbolic execution on gdb
Triton and symbolic execution on gdb
 
Simple Ruby DSL Techniques: Big Project Impact!
Simple Ruby DSL Techniques: Big Project Impact!Simple Ruby DSL Techniques: Big Project Impact!
Simple Ruby DSL Techniques: Big Project Impact!
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
Javaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 GroovybuildersJavaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 Groovybuilders
 
Go Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGo Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii Shapoval
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
 
Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)
 
Exploring Clojurescript
Exploring ClojurescriptExploring Clojurescript
Exploring Clojurescript
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Better DSL Support for Groovy-Eclipse

  • 1. What’s new in Groovy & Grails Support? DSL Support in Groovy-Eclipse Andrew Eisenberg, SpringSource Tools Team © 2011 SpringSource, A division of VMware. All rights reserved
  • 2. What’s new in Groovy & Grails Support? Part 1 © 2011 SpringSource, A division of VMware. All rights reserved
  • 3. New Groovy-Eclipse Support in 2.5.0   DSL Descriptors (discussed later)   Groovy 1.8   Parameter guessing content assist   Script outline view   Distinguish read vs. write access in search   Conditional breakpoints in Groovy files (STS only) 3
  • 4. New Grails tooling support in STS 2.7.0.M1   Service field content assist   Groovy search results in GSPs 4
  • 5. Gradle support in STS Part 1.5 © 2011 SpringSource, A division of VMware. All rights reserved
  • 6. First cut at Gradle support now available in STS   Demoed this morning in the Gradle talk   Yay! 6
  • 7. DSL Support in Groovy-Eclipse Part 2 © 2011 SpringSource, A division of VMware. All rights reserved
  • 9. A DSL for distance calculations 3.m + 2.yd + 2.mi - 1.km In the Groovy editor: Uh oh! Can we do better??? 9
  • 11. DSL Descriptors   Teach the IDE about DSLs through scripting CONFIDENTIAL 11
  • 12. DSL Descriptors   In English: •  “Any subtype of Number should have the following properties: m, yd, mi, km”   In DSLD: •  “Any subtype of Number”: currentType( subType( Number ) )! •  “…the following properties…”: [ “m”, “yd”, “cm”, “mi”, “km” ].each {! property name:it, type:"Distance”! }! 3.m + 2.yd + 2.mi - 1.km 12
  • 13. Let’s see that   Ex 1: Distances 13
  • 14. Anatomy of a DSLD file 14
  • 15. DSLD and the Inferencing Engine   Hooks into Groovy-Eclipse’s type inferencing engine •  Visit each expression AST node •  Determine type using previous expression •  Move to next expression   DSLD operates on Groovy AST Expression nodes •  Exposes Groovy AST nodes and uses Groovy API   In the background, while typing (reconciling) org.codehaus.groovy.ast.expr.Expression! 15
  • 16. Pointcuts and Contribution blocks   Pointcuts: •  Where to do it. •  What is the current expression? •  Declaring type? class Other {! •  Enclosing class? def x! }!   Contribution blocks: class Foo {! •  What to do def method() {! •  “Add” method new Other().x! •  “Add” property }! }! •  (not at runtime, in the editor only) 16
  • 17. What goes in a Contribution Block?   property : “adds” a property (…).accept {! •  arguments property name: “myName”! •  name: “blarb” method name: “getMyName”! }! •  type: “java.lang.String” •  declaringType :”com.foo.Frumble” •  isStatic: false •  doc: “Some html” •  provider: “My DSL”   method : “adds” a method •  all arguments above, and •  params: [firstName:“java.lang.String”, lastName:“java.lang.String”] •  useNamedArgs: true   name is required, others optional 17
  • 18. Pointcuts   currentType() : Matches on the current declaring type   enclosingClass() : Matches on the enclosing class   currentType(“com.bar.Foo”)   methods(“run”)   annotatedBy(“org.junit.runner.RunWith”)   enclosingClass( annotatedBy(“org.junit.runner.RunWith”) ) & currentType(methods(“run”) ) 18
  • 19. Where does this pointcut match? What does it add? (enclosingClass(annotatedBy(“org.junit.runner.RunWith”)) & 
 currentType(methods(“run”))).accept { property name:”blarb” }! Looking for an expression that: @RunWith(Sumthin) ! class Foo {! def someTest() {! enclosed by @RunWith print “Hello”! def x = new MyRunner()! x.blarb! has run method }! blarb }! class MyRunner { def run() {…} }! 19
  • 20. Wait…isn’t this Aspect-Oriented Programming?   Pointcut •  Intentionally borrowed from AOP   AspectJ: pointcuts and advice •  operates on Java instructions at runtime class Foo {!   DSLD: pointcuts and contribution blocks def x = {! •  operates on AST def i = 0! org.codehaus.groovy.ast.expr.*!   Join Point Model i++! }! •  Join points (e.g., instructions, expressions) }! •  Mechanism for quantifying join points (e.g., pointcuts) •  Means of affect at a join point (e.g., advice, contribution blocks) 20
  • 21. Other things to help with DSLDs 21
  • 22. New DSLD Wizard   File  New  Groovy DSL Descriptor 22
  • 24. Groovy Event Console   Keep this open while implementing DSLDs: •  Shows exceptions •  Pointcuts •  Matches   Find the Console here: 24
  • 25. Groovy AST Viewer   Exploration of AST of current Groovy file 25
  • 26. Examples 26
  • 27. Basic Script Ex 2: Using the DSLD wizard 27
  • 28. Meta DSL Ex 3: DSLD script for editing DSLDs 28
  • 29. AST Transforms Ex 3: Standard AST Transforms 29
  • 30. SwingBuilder Ex 4: Long script, but simple to understand 30
  • 31. Grails Constraints DSL Ex 5: encapsulate Grails domain knowledge in a script 31
  • 32. Criteria Queries Ex 6: simple script, large effect 32
  • 33. Griffon Ex 7: from last night 33
  • 35. DSLD is not complete   Guided by user feedback   Collaboration with library developers •  Grails, Gaelyk, Griffon, etc.   Release standard DSLDs (AST Transforms, Builders, etc.) •  With Groovy-Eclipse? •  With Groovy core?   More pointcuts •  What do users need that isn’t implemented? •  regex(), instanceof(), superType(), enclosingEnum(), etc.   What about IntelliJ’s GDSL? 35
  • 36. Thanks!   More information: •  Google: groovy eclipse dsld   Full documentation on Codehaus.org: •  http://docs.codehaus.org/display/GROOVY/DSL+Descriptors+for+Groovy-Eclipse   Install from update site: •  http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/   Mailing list: •  eclipse-plugin-users@codehaus.org   Or chat with me whenever 36