DSLs with Groovy Saager Mhatre
<ul><li>github.com/dexterous </li></ul><ul><li>code.google.com/u/saager.mhatre </li></ul><ul><li>[email_address] </li></ul...
 
<ul><li>The  basic idea  of a domain   specific   language is… </li></ul>
<ul><li>… a computer language that's targeted to a particular kind of problem, rather than a general purpose language that...
<ul><li>…  a computer programming language of limited expressiveness focused on a particular domain. </li></ul><ul><li>Mar...
<ul><li>Chaar   Banarasi Masala </li></ul><ul><li>Zardaa   lagaa ke ,  Katri   supaari </li></ul><ul><li>Tamaakhu   jyaada...
 
 
http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html#enhance
Excerpted from org.hamcrest.examples.junit4.ExampleWithAssertThat.java Excerpted from http://code.google.com/p/logicalprac...
<ul><li>the popularity  of  DSLs is a  result  of… </li></ul>
<ul><li>improved developer productivity </li></ul>
<ul><li>better domain-expert interaction </li></ul>
 
 
 
 
 
 
 
 
 
 
<ul><li>If a  tree falls in a forest  and no one is  around to hear it , does it  make a sound ? </li></ul>
<ul><li>If a  Groovy enthusiast talks DSL in a conference  and no one is  interested in it , does it  help the software co...
 
<ul><li>If a  Groovy enthusiast talks DSL in a conference  and no one is  interested in it , does it  help the software co...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<ul><li>github.com/dexterous </li></ul><ul><li>code.google.com/u/saager.mhatre </li></ul><ul><li>[email_address] </li></ul...
Upcoming SlideShare
Loading in …5
×

Domain Specific Languages (DSLs) with Groovy [5th IndicThreads Conference On Java, 2010, Pune, India]

1,920 views
1,851 views

Published on

Session Presented at 5th IndicThreads.com Conference On Java held on 10-11 December 2010 in Pune, India
WEB: http://J10.IndicThreads.com

------------
Session Abstract:
The basic idea of a domain specific language (DSL) is a computer language that’s targeted to a particular kind of problem, rather than a general purpose language that’s aimed at any kind of software problem.

In this session we will start by understanding what a DSL is through examples from the wild. Following that, I intend to bring out the flexibility afforded by dynamic languages (Groovy in particular) that provides developers with the tools to build their own DSLs with relative ease. We will see examples of mini languages built in under 50 LOC that make everyday boilerplate code look downright sexy! I will elaborate on several Groovy specific features, especially those that I feel contribute significantly towards making it a good workbench for DSLs. A basic understanding of dynamic languages will be a prerequisite for this session.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,920
On SlideShare
0
From Embeds
0
Number of Embeds
826
Actions
Shares
0
Downloads
21
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • What is DSL? Used DSL Built DSL
  • Internal DSL Possibly one of the nicest examples of a fluent DSL with Static Typing
  • What is DSL? Used DSL Built DSL
  • Dynamic language, we don’t need types Getters/setters eliminated by autogenerated properties All those semi-colons…
  • Autogenerated default constructor
  • Main to script
  • Class has been reduced to it’s essentials On to list notation and list processing functions- blocks and closures
  • Chaining list processing GStrings
  • Dynamic language, we don’t need types Getters/setters eliminated by autogenerated properties All those semi-colons…
  • Domain Specific Languages (DSLs) with Groovy [5th IndicThreads Conference On Java, 2010, Pune, India]

    1. 1. DSLs with Groovy Saager Mhatre
    2. 2. <ul><li>github.com/dexterous </li></ul><ul><li>code.google.com/u/saager.mhatre </li></ul><ul><li>[email_address] </li></ul><ul><li>thinkaround.blogspot.com </li></ul><ul><li>@dexterous </li></ul>
    3. 4. <ul><li>The basic idea of a domain specific language is… </li></ul>
    4. 5. <ul><li>… a computer language that's targeted to a particular kind of problem, rather than a general purpose language that's aimed at any kind of software problem. </li></ul><ul><li>Martin Fowler http://www.martinfowler.com/bliki/DomainSpecificLanguage.html </li></ul>
    5. 6. <ul><li>… a computer programming language of limited expressiveness focused on a particular domain. </li></ul><ul><li>Martin Fowler Domain Specific Languages </li></ul>
    6. 7. <ul><li>Chaar Banarasi Masala </li></ul><ul><li>Zardaa lagaa ke , Katri supaari </li></ul><ul><li>Tamaakhu jyaada , Gulkand kam </li></ul>
    7. 10. http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html#enhance
    8. 11. Excerpted from org.hamcrest.examples.junit4.ExampleWithAssertThat.java Excerpted from http://code.google.com/p/logicalpractice-collections/wiki/GettingStarted
    9. 12. <ul><li>the popularity of DSLs is a result of… </li></ul>
    10. 13. <ul><li>improved developer productivity </li></ul>
    11. 14. <ul><li>better domain-expert interaction </li></ul>
    12. 25. <ul><li>If a tree falls in a forest and no one is around to hear it , does it make a sound ? </li></ul>
    13. 26. <ul><li>If a Groovy enthusiast talks DSL in a conference and no one is interested in it , does it help the software community ? </li></ul>
    14. 28. <ul><li>If a Groovy enthusiast talks DSL in a conference and no one is interested in it , does it help the software community ? </li></ul>
    15. 58. <ul><li>github.com/dexterous </li></ul><ul><li>code.google.com/u/saager.mhatre </li></ul><ul><li>[email_address] </li></ul><ul><li>thinkaround.blogspot.com </li></ul><ul><li>@dexterous </li></ul>

    ×