- Shopping Bag ( 0 items )
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 ...
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
This book is a software developer's guide to using the Microsoft Tools for Domain-Specific Languages ("DSL Tools"), which are included in the SDK (Software Development Kit) for Microsoft Visual Studio 2005.
The software industry is showing considerable interest in using "domain-specific languages," an approach to building software that promises to reduce software development costs, especially in large projects. A domain-specific language (DSL) is a language specially geared to working within a particular area of interest: a vertical domain such as telephone design, or a horizontal one like workflow. It may be a programming language or a specification or design language. It may be textual or graphical, or a mixture of both. The language is expressed in terms that are used in a particular domain, such as "connect," "ringtone," or "work item," uncluttered by the details of how those concepts are implemented. Software, configuration files, resources, and other documents can be generated from instances of the language—often many of those artifacts can be generated from one DSL—or the language may be interpreted directly. This makes it much easier to discuss the software at the requirements level, and to make changes in an agile way. In vertical domains, the accessibility of the language to business users helps when discussing requirements with them.
DSLs are not a new idea—HTML and SQL are well-known examples of DSLs. Less widespread, however, is the idea of creating your own DSL for your own project. The purpose of the Microsoft DSL Tools is to reduce the upfront cost of doing so. You can quickly create a range of diagrammatic languages, such as workflow, class,or entity diagrams, and you can create tools for generating artifacts from them. Goals and Scope
This book is for you if you are a software developer or architect using, or thinking about using, the Microsoft DSL Tools. It explains how to create and use languages, how to tune them to your needs, and how to employ them within the context of your project. The book should also be of significant value to readers who are interested in the broader general topic of domain-specific languages, or who wish to compare and contrast different approaches to model-driven development, or tools that support model-driven development. Chapters 1 and 11 discuss the more general topic of domain-specific languages, and how you go about designing one. The middle chapters focus exclusively on providing a detailed yet readable reference on building DSLs and code generators using the DSL Tools.
The book's authors are the main designers of the Microsoft DSL Tools. They have worked together on the product since its inception, and are responsible for most of the key design decisions. Why You Might Want to Use DSL Tools
If you (or your organization) are writing the same or similar code repeatedly, whether within a single large project or over the course of multiple projects, then such code can probably be generated. If this is the case, you should consider using the DSL Tools as a way to generate this code. This is especially the case if the code can be generated from structures that can easily be understood by domain specialists rather than software development specialists. After reading this book, you should be able to assess the capabilities of the DSL Tools to address problems of this kind, either directly or after some customization. Organization of This Book
Chapter 1, Domain-Specific Development, explains the DSL approach, compares it with similar techniques, and introduces typical scenarios in which a DSL is used.
Chapter 2, Creating and Using DSLs, looks at the various parts of the DSL Tools system, shows how they fit together, and introduces the main examples that will be used through the remainder of the book.
Chapter 3, Domain Model Definition, details how to define the concepts of the language.
Chapter 4, Presentation, deals with defining the visual appearance of your language.
Chapter 5, Creation, Deletion, and Update Behavior, covers these important aspects of the behavior of your language.
Chapter 6, Serialization, deals with how models and diagrams in your language are represented in files.
Chapter 7, Constraints and Validation, shows you how to ensure that the users of your language create valid statements.
Chapter 8, Generating Artifacts, shows you how to use your language to drive or configure your system by creating configuration files, program code, resources, and other artifacts.
Chapter 9, Deploying a DSL, explains how to create an installer that will install your finished language on multiple computers.
Chapter 10, Advanced DSL Customization, shows you how to make specialized features of your language (or specialized behavior in the editor) in addition to those provided by the standard definition facilities.
Chapter 11, Designing a DSL, provides a lightweight kit of principles and procedures for developing and evolving languages within the context of your project.
Updates and all of the main examples are available for download at the website www.domainspecificdevelopment.com. What You Need to Use This Book
To get the full value of this book, you need to be reasonably familiar with the facilities that Visual Studio offers to developers of program code, including the code editor and
DSL Tools can be downloaded as part of the Visual Studio SDK and used with Visual Studio Professional Edition and later. Tools created using the DSL Tools can be deployed on Visual Studio Standard Edition and later. The website http://msdn.microsoft.com/vstudio/DSLTools/ is the entry point to information about the DSL Tools. There you can find links to where the SDK can be downloaded, a popular online forum with active discussions about the DSL Tools, weblogs containing discussions about the DSL Tools by the authors of this book and others, a tool for reporting bugs and making suggestions, white papers, chats, and other resources.
Domain-Specific Development 2
Textual DSLs 15
Graphical DSLs 20
Aspects of Graphical DSLs 23
DSLs in Visual Studio 27
The Customization Pit 32
Chapter 2 Creating and Using DSLs 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
Chapter 3 Domain Model Definition 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
Chapter 4 Presentation 133
Graphical Notation--Overview 134
Diagram and Editor 137
Customizing the Graphical Notation in Code 173
Properties Window 188
Chapter 5 Creation, Deletion, and Update Behavior 197
Element Creation 197
Connection Builders 216
Element Deletion 229
Chapter 6 Serialization 237
Saving and Loading Models and Diagrams 238
Model XML File Format 239
Elements and Properties 242
Diagram XML File Format 251
Versioning and Migration 254
The XML Schema 257
Generated Serialization Code 264
Chapter 7 Constraints and Validation 275
Choosing Hard or Soft Constraints? 277
Soft Constraints in the DSL Tools 280
Hard Constraints in the DSL Tools 295
Putting Together Hard and Soft Constraints 299
Chapter 8 Generating Artifacts 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
Chapter 9 Deploying a DSL 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
Chapter 10 Advanced DSL Customization 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
Chapter 11 Designing a DSL 455
Identifying Variability 456
Developing the Domain Model 460
Developing the Notation 468
Defining Validation Constraints 475
Developing and Evolving the Framework 479
Evolving a DSL 489
What Makes a Good DSL? 491
Posted May 2, 2013