Domain Specific Languages (DSL) and Domain-Driven Design (DDD) are two related concepts that have been kicking around the edges of the software engineering world for a few years, but have recently started to move much more towards center stage. A DSL is a language specially geared to working within a particular area of interest: it might be a vertical domain such as telephone design, or a horizontal one like workflow. Some well-known examples of DSLs are HTML and SQL. What is radically new is the idea of creating your own DSL for your own project. Microsoft has actually been at the forefront of promoting the use of DSLs, and has recently announced the Microsoft DSL Tools. The Microsoft DSL Tools will help developers create their own languages more easily, and work together very closely with Visual Studio Team System. This book's authors are the main designers of the Microsoft DSL Tools. They've written a book that is straightforwardly focused on understanding and using these tools; it intends to provide a detailed yet readable reference to the tools. Product Description
Domain-Specific Languages (DSLs)--languages geared to specific vertical or horizontal areas of interest--are generating growing excitement from software engineers and architects. DSLs bring new agility to the creation and evolution of software, allowing selected design aspects to be expressed in terms much closer to the system requirements than standard program code, significantly reducing development costs in large-scale projects and product lines. In this breakthrough book, four leading experts reveal exactly how DSLs work, and how you can make the most of them in your environment.
With Domain-Specific Development with Visual Studio DSL Tools, you'll begin by mastering DSL concepts and techniques that apply to all platforms. Next, you'll discover how to create and use DSLs with the powerful new Microsoft DSL Tools--a toolset designed by this book's authors. Learn how the DSL Tools integrate into Visual Studio--and how to define DSLs and generate Visual Designers using Visual Studio's built-in modeling technology.
In-depth coverage includes
Determining whether DSLs will work for you
Comparing DSLs with other approaches to model-driven development
Defining, tuning, and evolving DSLs: models, presentation, creation, updates, serialization, constraints, validation, and more
Creating Visual Designers for new DSLs with little or no coding
Multiplying productivity by generating application code from your models with easy-to-use text templates
Automatically generating configuration files, resources, and other artifacts
Deploying Visual Designers across the organization, quickly and easily
Customizing Visual Designers for specialized process needs
List of Figures
List of Tables
Foreword
Preface
About the Authors
Chapter 1 Domain-Specific Development
Chapter 2 Creating and Using DSLs
Chapter 3 Domain Model Definition
Chapter 4 Presentation
Chapter 5 Creation, Deletion, and Update Behavior
Chapter 6 Serialization
Chapter 7 Constraints and Validation
Chapter 8 Generating Artifacts
Chapter 9 Deploying a DSL
Chapter 10 Advanced DSL Customization
Chapter 11 Designing a DSL
Index
Backcover
Domain-Specific Languages (DSLs)--languages geared to specific vertical or horizontal areas of interest--are generating growing excitement from software engineers and architects. DSLs bring new agility to the creation and evolution of software, allowing selected design aspects to be expressed in terms much closer to the system requirements than standard program code, significantly reducing development costs in large-scale projects and product lines. In this breakthrough book, four leading experts reveal exactly how DSLs work, and how you can make the most of them in your environment.
With Domain-Specific Development with Visual Studio DSL Tools, you'll begin by mastering DSL concepts and techniques that apply to all platforms. Next, you'll discover how to create and use DSLs with the powerful new Microsoft DSL Tools--a toolset designed by this book's authors. Learn how the DSL Tools integrate into Visual Studio--and how to define DSLs and generate Visual Designers using Visual Studio's built-in modeling technology.
In-depth coverage includes
Determining whether DSLs will work for you
Comparing DSLs with other approaches to model-driven development
Defining, tuning, and evolving DSLs: models, presentation, creation, updates, serialization, constraints, validation, and more
Creating Visual Designers for new DSLs with little or no coding
Multiplying productivity by generating application code from your models with easy-to-use text templates
Automatically generating configuration files, resources, and other artifacts
Deploying Visual Designers across the organization, quickly and easily
Customizing Visual Designers for specialized process needs
List of Figures
List of Tables
Foreword
Preface
About the Authors
Chapter 1 Domain-Specific Development
Chapter 2 Creating and Using DSLs
Chapter 3 Domain Model Definition
Chapter 4 Presentation
Chapter 5 Creation, Deletion, and Update Behavior
Chapter 6 Serialization
Chapter 7 Constraints and Validation
Chapter 8 Generating Artifacts
Chapter 9 Deploying a DSL
Chapter 10 Advanced DSL Customization
Chapter 11 Designing a DSL
Index
List of Figures xviiList of Tables xxvForeword xxviiPreface xxixAbout the Authors xxxvChapter 1 Domain-Specific Development 1 Introduction 1
Domain-Specific Development 2
Examples 4
Benefits 10
Languages 11
Textual DSLs 15
Graphical DSLs 20
Aspects of Graphical DSLs 23
DSLs in Visual Studio 27
The Customization Pit 32
UML 34
Summary 40
Chapter 2 Creating and Using DSLs 41 Introduction 41
Process: Incremental Development of DSLs 41
Creating a DSL in Visual Studio 57
A Second DSL: The Project Definition DSL 77
Architecture of the DSL Tools 78
Summary 85
Chapter 3 Domain Model Definition 87 Introduction 87
The Domain Model Designer 88
The In-Memory Store 89
Domain Classes 92
Domain Relationships 98
Generating a Designer with No Shapes 108
The Generated Code 109
More about Domain Classes 115
More about Domain Properties 119
More on Domain Relationships and Roles 122
More about the Store 129
Summary 131
Chapter 4 Presentation 133 Introduction 133
Graphical Notation--Overview 134
Diagram and Editor 137
Shapes 146
Connectors 164
Decorators 167
Customizing the Graphical Notation in Code 173
Explorer 180
Properties Window 188
Summary 195
Chapter 5 Creation, Deletion, and Update Behavior 197 Introduction 197
Element Creation 197
Connection Builders 216
Element Deletion 229
Summary 234
Chapter 6 Serialization 237 Introduction 237
Saving and Loading Models and Diagrams 238
Model XML File Format 239
Elements and Properties 242
Relationships 243
Cross-Referencing 245
Diagram XML File Format 251
Versioning and Migration 254
The XML Schema 257
Customization 258
Generated Serialization Code 264
Summary 273
Chapter 7 Constraints and Validation 275 Introduction 275
Choosing Hard or Soft Constraints? 277
Soft Constraints in the DSL Tools 280
Hard Constraints in the DSL Tools 295
Rules 296
Putting Together Hard and Soft Constraints 299
Summary 307
Chapter 8 Generating Artifacts 309 Introduction 309
Artifact Generation Styles 311
Complex Relationships and Round-Tripping 321
The Templatization Process 325
Syntax of a Text Template 341
Problems of Large-Scale, Real-World Artifact Generation 349
Advanced Customizations 351
Summary 366
Chapter 9 Deploying a DSL 369 Introduction 369
Files Needed to Install a Designer 370
Getting Started--Creating a Setup Project 373
Setup Project Contents 376
Customizing Setup 377
The .dslsetup Format 378
Refreshing the Installation Files 387
Package Load Key 388
Deploying Text Templates for Code Generation 390
Summary 396
Chapter 10 Advanced DSL Customization 397 Introduction 397
Tools for Customization 397
Responding to Changes 402
DSL Shell Architecture 426
How to Add a Menu Command 429
Building the DSL Diagram into Another Interface 435
Implementing Copy and Paste 437
Shape Containers 442
Summary 453
Chapter 11 Designing a DSL 455 Introduction 455
Identifying Variability 456
Developing the Domain Model 460
Developing the Notation 468
Defining Validation Constraints 475
Developing and Evolving the Framework 479
Testing 484
Evolving a DSL 489
What Makes a Good DSL? 491
Summary 498
Conclusion 499
Index 503
Domain-Specific Languages (DSLs)--languages geared to specific vertical or horizontal areas of interest--are generating growing excitement from software engineers and architects. DSLs bring new agility to the creation and evolution of software, allowing selected design aspects to be expressed in terms much closer to the system requirements than standard program code, significantly reducing development costs in large-scale projects and product lines. In this breakthrough book, four leading experts reveal exactly how DSLs work, and how you can make the most of them in your environment.
With Domain-Specific Development with Visual Studio DSL Tools, you'll begin by mastering DSL concepts and techniques that apply to all platforms. Next, you'll discover how to create and use DSLs with the powerful new Microsoft DSL Tools--a toolset designed by this book's authors. Learn how the DSL Tools integrate into Visual Studio--and how to define DSLs and generate Visual Designers using Visual Studio's built-in modeling technology.
In-depth coverage includes
Determining whether DSLs will work for you Comparing DSLs with other approaches to model-driven development Defining, tuning, and evolving DSLs: models, presentation, creation, updates, serialization, constraints, validation, and more Creating Visual Designers for new DSLs with little or no coding Multiplying productivity by generating application code from your models with easy-to-use text templates Automatically generating configuration files, resources, and other artifacts Deploying Visual Designers across the organization, quickly and easily Customizing Visual Designers for specialized process needs
List of Figures
List of Tables
Foreword
Preface
About the Authors
Chapter 1 Domain-Specific Development
Chapter 2 Creating and Using DSLs
Chapter 3 Domain Model Definition
Chapter 4 Presentation
Chapter 5 Creation, Deletion, and Update Behavior
Chapter 6 Serialization
Chapter 7 Constraints and Validation
Chapter 8 Generating Artifacts
Chapter 9 Deploying a DSL
Chapter 10 Advanced DSL Customization
Chapter 11 Designing a DSL
Index
Domain-Specific Languages (DSLs)--languages geared to specific vertical or horizontal areas of interest--are generating growing excitement from software engineers and architects. DSLs bring new agility to the creation and evolution of software, allowing selected design aspects to be expressed in terms much closer to the system requirements than standard program code, significantly reducing development costs in large-scale projects and product lines. In this breakthrough book, four leading experts reveal exactly how DSLs work, and how you can make the most of them in your environment.
With Domain-Specific Development with Visual Studio DSL Tools, you'll begin by mastering DSL concepts and techniques that apply to all platforms. Next, you'll discover how to create and use DSLs with the powerful new Microsoft DSL Tools--a toolset designed by this book's authors. Learn how the DSL Tools integrate into Visual Studio--and how to define DSLs and generate Visual Designers using Visual Studio's built-in modeling technology.
In-depth coverage includes
Determining whether DSLs will work for you
Comparing DSLs with other approaches to model-driven development
Defining, tuning, and evolving DSLs: models, presentation, creation, updates, serialization, constraints, validation, and more
Creating Visual Designers for new DSLs with little or no coding
Multiplying productivity by generating application code from your models with easy-to-use text templates
Automatically generating configuration files, resources, and other artifacts
Deploying Visual Designers across the organization, quickly and easily
Customizing Visual Designers for specialized process needs
List of Figures
List of Tables
Foreword
Preface
About the Authors
Chapter 1 Domain-Specific Development
Chapter 2 Creating and Using DSLs
Chapter 3 Domain Model Definition
Chapter 4 Presentation
Chapter 5 Creation, Deletion, and Update Behavior
Chapter 6 Serialization
Chapter 7 Constraints and Validation
Chapter 8 Generating Artifacts
Chapter 9 Deploying a DSL
Chapter 10 Advanced DSL Customization
Chapter 11 Designing a DSL
Index
Backcover
Domain-Specific Languages (DSLs)--languages geared to specific vertical or horizontal areas of interest--are generating growing excitement from software engineers and architects. DSLs bring new agility to the creation and evolution of software, allowing selected design aspects to be expressed in terms much closer to the system requirements than standard program code, significantly reducing development costs in large-scale projects and product lines. In this breakthrough book, four leading experts reveal exactly how DSLs work, and how you can make the most of them in your environment.
With Domain-Specific Development with Visual Studio DSL Tools, you'll begin by mastering DSL concepts and techniques that apply to all platforms. Next, you'll discover how to create and use DSLs with the powerful new Microsoft DSL Tools--a toolset designed by this book's authors. Learn how the DSL Tools integrate into Visual Studio--and how to define DSLs and generate Visual Designers using Visual Studio's built-in modeling technology.
In-depth coverage includes
Determining whether DSLs will work for you
Comparing DSLs with other approaches to model-driven development
Defining, tuning, and evolving DSLs: models, presentation, creation, updates, serialization, constraints, validation, and more
Creating Visual Designers for new DSLs with little or no coding
Multiplying productivity by generating application code from your models with easy-to-use text templates
Automatically generating configuration files, resources, and other artifacts
Deploying Visual Designers across the organization, quickly and easily
Customizing Visual Designers for specialized process needs
List of Figures
List of Tables
Foreword
Preface
About the Authors
Chapter 1 Domain-Specific Development
Chapter 2 Creating and Using DSLs
Chapter 3 Domain Model Definition
Chapter 4 Presentation
Chapter 5 Creation, Deletion, and Update Behavior
Chapter 6 Serialization
Chapter 7 Constraints and Validation
Chapter 8 Generating Artifacts
Chapter 9 Deploying a DSL
Chapter 10 Advanced DSL Customization
Chapter 11 Designing a DSL
Index
List of Figures xviiList of Tables xxvForeword xxviiPreface xxixAbout the Authors xxxvChapter 1 Domain-Specific Development 1 Introduction 1
Domain-Specific Development 2
Examples 4
Benefits 10
Languages 11
Textual DSLs 15
Graphical DSLs 20
Aspects of Graphical DSLs 23
DSLs in Visual Studio 27
The Customization Pit 32
UML 34
Summary 40
Chapter 2 Creating and Using DSLs 41 Introduction 41
Process: Incremental Development of DSLs 41
Creating a DSL in Visual Studio 57
A Second DSL: The Project Definition DSL 77
Architecture of the DSL Tools 78
Summary 85
Chapter 3 Domain Model Definition 87 Introduction 87
The Domain Model Designer 88
The In-Memory Store 89
Domain Classes 92
Domain Relationships 98
Generating a Designer with No Shapes 108
The Generated Code 109
More about Domain Classes 115
More about Domain Properties 119
More on Domain Relationships and Roles 122
More about the Store 129
Summary 131
Chapter 4 Presentation 133 Introduction 133
Graphical Notation--Overview 134
Diagram and Editor 137
Shapes 146
Connectors 164
Decorators 167
Customizing the Graphical Notation in Code 173
Explorer 180
Properties Window 188
Summary 195
Chapter 5 Creation, Deletion, and Update Behavior 197 Introduction 197
Element Creation 197
Connection Builders 216
Element Deletion 229
Summary 234
Chapter 6 Serialization 237 Introduction 237
Saving and Loading Models and Diagrams 238
Model XML File Format 239
Elements and Properties 242
Relationships 243
Cross-Referencing 245
Diagram XML File Format 251
Versioning and Migration 254
The XML Schema 257
Customization 258
Generated Serialization Code 264
Summary 273
Chapter 7 Constraints and Validation 275 Introduction 275
Choosing Hard or Soft Constraints? 277
Soft Constraints in the DSL Tools 280
Hard Constraints in the DSL Tools 295
Rules 296
Putting Together Hard and Soft Constraints 299
Summary 307
Chapter 8 Generating Artifacts 309 Introduction 309
Artifact Generation Styles 311
Complex Relationships and Round-Tripping 321
The Templatization Process 325
Syntax of a Text Template 341
Problems of Large-Scale, Real-World Artifact Generation 349
Advanced Customizations 351
Summary 366
Chapter 9 Deploying a DSL 369 Introduction 369
Files Needed to Install a Designer 370
Getting Started--Creating a Setup Project 373
Setup Project Contents 376
Customizing Setup 377
The .dslsetup Format 378
Refreshing the Installation Files 387
Package Load Key 388
Deploying Text Templates for Code Generation 390
Summary 396
Chapter 10 Advanced DSL Customization 397 Introduction 397
Tools for Customization 397
Responding to Changes 402
DSL Shell Architecture 426
How to Add a Menu Command 429
Building the DSL Diagram into Another Interface 435
Implementing Copy and Paste 437
Shape Containers 442
Summary 453
Chapter 11 Designing a DSL 455 Introduction 455
Identifying Variability 456
Developing the Domain Model 460
Developing the Notation 468
Defining Validation Constraints 475
Developing and Evolving the Framework 479
Testing 484
Evolving a DSL 489
What Makes a Good DSL? 491
Summary 498
Conclusion 499
Index 503
Domain-Specific Languages (DSLs)--languages geared to specific vertical or horizontal areas of interest--are generating growing excitement from software engineers and architects. DSLs bring new agility to the creation and evolution of software, allowing selected design aspects to be expressed in terms much closer to the system requirements than standard program code, significantly reducing development costs in large-scale projects and product lines. In this breakthrough book, four leading experts reveal exactly how DSLs work, and how you can make the most of them in your environment.
With Domain-Specific Development with Visual Studio DSL Tools, you'll begin by mastering DSL concepts and techniques that apply to all platforms. Next, you'll discover how to create and use DSLs with the powerful new Microsoft DSL Tools--a toolset designed by this book's authors. Learn how the DSL Tools integrate into Visual Studio--and how to define DSLs and generate Visual Designers using Visual Studio's built-in modeling technology.
In-depth coverage includes
Determining whether DSLs will work for you Comparing DSLs with other approaches to model-driven development Defining, tuning, and evolving DSLs: models, presentation, creation, updates, serialization, constraints, validation, and more Creating Visual Designers for new DSLs with little or no coding Multiplying productivity by generating application code from your models with easy-to-use text templates Automatically generating configuration files, resources, and other artifacts Deploying Visual Designers across the organization, quickly and easily Customizing Visual Designers for specialized process needs
List of Figures
List of Tables
Foreword
Preface
About the Authors
Chapter 1 Domain-Specific Development
Chapter 2 Creating and Using DSLs
Chapter 3 Domain Model Definition
Chapter 4 Presentation
Chapter 5 Creation, Deletion, and Update Behavior
Chapter 6 Serialization
Chapter 7 Constraints and Validation
Chapter 8 Generating Artifacts
Chapter 9 Deploying a DSL
Chapter 10 Advanced DSL Customization
Chapter 11 Designing a DSL
Index