
Domain-Specific Languages
Versandkostenfrei!
Versandfertig in über 4 Wochen
56,99 €
inkl. MwSt.
Weitere Ausgaben:
PAYBACK Punkte
28 °P sammeln!
Designed as a wide-ranging guide to Domain Specific Languages (DSLs) and how to approach building them, this book covers a variety of different techniques available for DSLs. The goal is to provide readers with enough information to make an informed choice about whether or not to use a DSL and what kinds of DSL techniques to employ. Part I is a 150-page narrative overview that gives you a broad understanding of general principles. The reference material in Parts II through VI provides the details and examples you'll need to get started using the various techniques discussed. Both internal and external DSL topics are covered, in addition to alternative computational models and code generation. Although the general principles and patterns presented can be used with whatever programming language you happen to be using, most of the examples are in Java or C#. Product 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
Backcover
Designed as a wide-ranging guide to Domain Specific Languages (DSLs) and how to approach building them, this book covers a variety of different techniques available for DSLs. The goal is to provide readers with enough information to make an informed choice about whether or not to use a DSL and what kinds of DSL techniques to employ. Part I is a 150-page narrative overview that gives you a broad understanding of general principles. The reference material in Parts II through VI provides the details and examples you will need to get started using the various techniques discussed. Both internal and external DSL topics are covered, in addition to alternative computational models and code generation. Although the general principles and patterns presented can be used with whatever programming language you happen to be using, most of the examples are in Java or C#. Preface xix
Part I: Narratives 1
Chapter 1: An Introductory Example 3
Gothic Security 3
The State Machine Model 5
Programming Miss Grant's Controller 9
Languages and Semantic Model 16
Using Code Generation 19
Using Language Workbenches 22
Visualization 24
Chapter 2: Using Domain-Specific Languages 27
Defining Domain-Specific Languages 27
Why Use a DSL? 33
Problems with DSLs 36
Wider Language Processing 39
DSL Lifecycle 40
What Makes a Good DSL Design? 42
Chapter 3: Implementing DSLs 43
Architecture of DSL Processing 43
The Workings of a Parser 47
Grammars, Syntax, and Semantics 49
Parsing Data 50
Macros 52
Chapter 4: Implementing an Internal DSL 67
Fluent and Command-Query APIs 68
The Need for a Parsing Layer 71
Using Functions 72
Literal Collections 77
Using Grammars to Choose Internal Elements 79
Closures 80
Parse Tree Manipulation 82
Annotation 84
Literal Extension 85
Reducing the Syntactic Noise 85
Dynamic Reception 86
Providing Some Type Checking 87
Chapter 5: Implementing an External DSL 89
Syntactic Analysis Strategy 89
Output Production Strategy 92
Parsing Concepts 94
Mixing-in Another Language 100
XML DSLs 101
Chapter 6: Choosing between Internal and External DSLs 105
Learning Curve 105
Cost of Building 106
Programmer Familiarity 107
Communication with Domain Experts 108
Mixing In the Host Language 108
Strong Expressiveness Boundary 109
Runtime Configuration 110
Sliding into Generality 110
Composing DSLs 111
Summing Up 111
Chapter 7: Alternative Computational Models 113
A Few Alternative Models 116
Chapter 8: Code Generation 121
Choosing What to Generate 122
How to Generate 124
Mixing Generated and Handwritten Code 126
Generating Readable Code 127
Preparse Code Generation 128
Further Reading 128
Chapter 9: Language Workbenches 129
Elements of Language Workbenches 130
Schema Definition Languages and Meta-Models 131
Source and Projectional Editing 136
Illustrative Programming 138
Tools Tour 140
Language Workbenches and CASE tools 141
Should You Use a Language Workbench? 142
Part II: Common Topics 145
Chapter 10: A Zoo of DSLs &nb
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
Backcover
Designed as a wide-ranging guide to Domain Specific Languages (DSLs) and how to approach building them, this book covers a variety of different techniques available for DSLs. The goal is to provide readers with enough information to make an informed choice about whether or not to use a DSL and what kinds of DSL techniques to employ. Part I is a 150-page narrative overview that gives you a broad understanding of general principles. The reference material in Parts II through VI provides the details and examples you will need to get started using the various techniques discussed. Both internal and external DSL topics are covered, in addition to alternative computational models and code generation. Although the general principles and patterns presented can be used with whatever programming language you happen to be using, most of the examples are in Java or C#. Preface xix
Part I: Narratives 1
Chapter 1: An Introductory Example 3
Gothic Security 3
The State Machine Model 5
Programming Miss Grant's Controller 9
Languages and Semantic Model 16
Using Code Generation 19
Using Language Workbenches 22
Visualization 24
Chapter 2: Using Domain-Specific Languages 27
Defining Domain-Specific Languages 27
Why Use a DSL? 33
Problems with DSLs 36
Wider Language Processing 39
DSL Lifecycle 40
What Makes a Good DSL Design? 42
Chapter 3: Implementing DSLs 43
Architecture of DSL Processing 43
The Workings of a Parser 47
Grammars, Syntax, and Semantics 49
Parsing Data 50
Macros 52
Chapter 4: Implementing an Internal DSL 67
Fluent and Command-Query APIs 68
The Need for a Parsing Layer 71
Using Functions 72
Literal Collections 77
Using Grammars to Choose Internal Elements 79
Closures 80
Parse Tree Manipulation 82
Annotation 84
Literal Extension 85
Reducing the Syntactic Noise 85
Dynamic Reception 86
Providing Some Type Checking 87
Chapter 5: Implementing an External DSL 89
Syntactic Analysis Strategy 89
Output Production Strategy 92
Parsing Concepts 94
Mixing-in Another Language 100
XML DSLs 101
Chapter 6: Choosing between Internal and External DSLs 105
Learning Curve 105
Cost of Building 106
Programmer Familiarity 107
Communication with Domain Experts 108
Mixing In the Host Language 108
Strong Expressiveness Boundary 109
Runtime Configuration 110
Sliding into Generality 110
Composing DSLs 111
Summing Up 111
Chapter 7: Alternative Computational Models 113
A Few Alternative Models 116
Chapter 8: Code Generation 121
Choosing What to Generate 122
How to Generate 124
Mixing Generated and Handwritten Code 126
Generating Readable Code 127
Preparse Code Generation 128
Further Reading 128
Chapter 9: Language Workbenches 129
Elements of Language Workbenches 130
Schema Definition Languages and Meta-Models 131
Source and Projectional Editing 136
Illustrative Programming 138
Tools Tour 140
Language Workbenches and CASE tools 141
Should You Use a Language Workbench? 142
Part II: Common Topics 145
Chapter 10: A Zoo of DSLs &nb
Designed as a wide-ranging guide to Domain Specific Languages (DSLs) and how to approach building them, this book covers a variety of different techniques available for DSLs. The goal is to provide readers with enough information to make an informed choice about whether or not to use a DSL and what kinds of DSL techniques to employ. Part I is a 150-page narrative overview that gives you a broad understanding of general principles. The reference material in Parts II through VI provides the details and examples you will need to get started using the various techniques discussed. Both internal and external DSL topics are covered, in addition to alternative computational models and code generation. Although the general principles and patterns presented can be used with whatever programming language you happen to be using, most of the examples are in Java or C#.