Domain Specific Languages

Book description

When carefully selected and used, Domain-Specific Languages (DSLs) may simplify complex code, promote effective communication with customers, improve productivity, and unclog development bottlenecks. In Domain-Specific Languages, noted software development expert Martin Fowler first provides the information software professionals need to decide if and when to utilize DSLs. Then, where DSLs prove suitable, Fowler presents effective techniques for building them, and guides software engineers in choosing the right approaches for their applications.


This book’s techniques may be utilized with most modern object-oriented languages; the author provides numerous examples in Java and C#, as well as selected examples in Ruby. Wherever possible, chapters are organized to be self-standing, and most reference topics are presented in a familiar patterns format.

Armed with this wide-ranging book, developers will have the knowledge they need to make important decisions about DSLs—and, where appropriate, gain the significant technical and business benefits they offer.

The topics covered include:

•      How DSLs compare to frameworks and libraries, and when those alternatives are sufficient

•      Using parsers and parser generators, and parsing external DSLs

•      Understanding, comparing, and choosing DSL language constructs

•      Determining whether to use code generation, and comparing code generation strategies

•      Previewing new language workbench tools for creating DSLs

Table of contents

  1. List of Patterns
  2. Title Page
  3. Copyright
  4. Dedication
  5. Contents
  6. Preface
  7. Part I. Narratives
    1. Chapter 1. An Introductory Example
    2. Chapter 2. Using Domain-Specific Languages
    3. Chapter 3. Implementing DSLs
    4. Chapter 4. Implementing an Internal DSL
    5. Chapter 5. Implementing an External DSL
    6. Chapter 6. Choosing between Internal and External DSLs
    7. Chapter 7. Alternative Computational Models
    8. Chapter 8. Code Generation
    9. Chapter 9. Language Workbenches
  8. Part II. Common Topics
    1. Chapter 10. A Zoo of DSLs
    2. Chapter 11. Semantic Model
    3. Chapter 12. Symbol Table
    4. Chapter 13. Context Variable
    5. Chapter 14. Construction Builder
    6. Chapter 15. Macro
    7. Chapter 16. Notification
  9. Part III. External DSL Topics
    1. Chapter 17. Delimiter-Directed Translation
    2. Chapter 18. Syntax-Directed Translation
    3. Chapter 19. BNF
    4. Chapter 20. Regex Table Lexer (by Rebecca Parsons)
    5. Chapter 21. Recursive Descent Parser (by Rebecca Parsons)
    6. Chapter 22. Parser Combinator (by Rebecca Parsons)
    7. Chapter 23. Parser Generator
    8. Chapter 24. Tree Construction
    9. Chapter 25. Embedded Translation
    10. Chapter 26. Embedded Interpretation
    11. Chapter 27. Foreign Code
    12. Chapter 28. Alternative Tokenization
    13. Chapter 29. Nested Operator Expression
    14. Chapter 30. Newline Separators
    15. Chapter 31. External DSL Miscellany
  10. Part IV. Internal DSL Topics
    1. Chapter 32. Expression Builder
    2. Chapter 33. Function Sequence
    3. Chapter 34. Nested Function
    4. Chapter 35. Method Chaining
    5. Chapter 36. Object Scoping
    6. Chapter 37. Closure
    7. Chapter 38. Nested Closure
    8. Chapter 39. Literal List
    9. Chapter 40. Literal Map
    10. Chapter 41. Dynamic Reception
    11. Chapter 42. Annotation
    12. Chapter 43. Parse Tree Manipulation
    13. Chapter 44. Class Symbol Table
    14. Chapter 45. Textual Polishing
    15. Chapter 46. Literal Extension
  11. Part V. Alternative Computational Models
    1. Chapter 47. Adaptive Model
    2. Chapter 48. Decision Table
    3. Chapter 49. Dependency Network
    4. Chapter 50. Production Rule System
    5. Chapter 51. State Machine
  12. Part VI. Code Generation
    1. Chapter 52. Transformer Generation
    2. Chapter 53. Templated Generation
    3. Chapter 54. Embedment Helper
    4. Chapter 55. Model-Aware Generation
    5. Chapter 56. Model Ignorant Generation
    6. Chapter 57. Generation Gap
  13. Bibliography
  14. Index
  15. A Cheat Sheet

Product information

  • Title: Domain Specific Languages
  • Author(s):
  • Release date: September 2010
  • Publisher(s): Addison-Wesley Professional
  • ISBN: 9780132107549