You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modeling/getting-started-with-domain-specific-languages.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Getting Started with Domain-Specific Languages
3
3
description: Explore the basic concepts to define and use a domain-specific language (DSL) created with the Modeling SDK for Visual Studio.
4
-
ms.date: 11/04/2016
4
+
ms.date: 11/13/2025
5
5
ms.topic: conceptual
6
6
author: mgoertz-msft
7
7
ms.author: mgoertz
@@ -15,15 +15,15 @@ This topic explains the basic concepts in defining and using a domain-specific l
15
15
> [!NOTE]
16
16
> The Text Template Transformation SDK and the Visual Studio Modeling SDK are installed automatically when you install specific features of Visual Studio. For more details, see [this blog post](https://devblogs.microsoft.com/devops/the-visual-studio-modeling-sdk-is-now-available-with-visual-studio-2017/).
17
17
18
-
If you are new to DSLs, we recommend that you work through the **VMSDK Lab**, which you can find in this [repository](https://github.com/lumon-Ind/VMSDK)
18
+
If you are new to DSLs, we recommend that you work through the **VMSDK Lab**, which you can find in this [repository](https://github.com/lumon-Ind/VMSDK-Labs.git)
19
19
20
20
## What can you do with a Domain-Specific Language?
21
21
22
22
A domain-specific language is a notation, usually graphical, that is designed to be used for a particular purpose. By contrast, languages such as UML are general-purpose. In a DSL, you can define the types of model element and their relationships, and how they are presented on the screen.
23
23
24
24
When you have designed a DSL, you can distribute it as part of a Visual Studio Integration Extension (VSIX) package. Users work with the DSL in Visual Studio:
25
25
26
-

26
+

27
27
28
28
The notation is only part of a DSL. Together with the notation, your VSIX package includes tools that users can apply to help them edit and generate material from their models.
29
29
@@ -55,16 +55,16 @@ To create a new domain-specific language, you create a new Visual Studio solutio
55
55
56
56
- Click **Domain-Specific Language Designer**, and then click **Next**.

77
77
78
78
- Enter a file name extension **ftree** for your DSL in the field **What extension should model files use?**. This is the extension that files containing instances of your DSL will use.
79
79
> [!IMPORTANT]
@@ -82,7 +82,7 @@ To create a new domain-specific language, you create a new Visual Studio solutio
82
82
83
83
7. Inspect the other pages (click **Next**) and then click **Finish**.
A solution is generated that contains two projects. They are named **Dsl** and **DslPackage**. A diagram file opens that is named **DslDefinition.dsl**.
88
88
@@ -142,7 +142,7 @@ You can run the DSL solution as soon as you have created it. Later, you can modi
142
142
143
143
Your experimental Visual Studio will resemble the following example:
144
144
145
-

145
+

146
146
147
147
### The Content of a Model
148
148
@@ -206,7 +206,7 @@ Rename the existing domain classes and relationships. For example, starting from
206
206
207
207
1. In the DslDefinition diagram, rename **ExampleModel** to **FamilyTreeModel**, **ExampleElement** to **Person**, **Targets** to **Children** (and Name to **Parent** ), **Sources** to **Parents** (and Name to **Child**), **Elements** to **People**, and the DomainRelationship **PersonReferencesChildren** to **ParentsHaveChildren**. Also rename the diagram element **ExampleConnector** to **ChildConnector**. You can click each label to change it.
208
208
209
-

209
+

210
210
211
211
2. Rename the element and connector tools.
212
212
@@ -295,7 +295,7 @@ Close the experimental instance of Visual Studio.
295
295
296
296
3. In **DSL Details**, on the **Decorator Maps** tab, click the check box on an unmapped decorator. In **Display property**, select the domain property to which you want it mapped. For example, map **BirthDecorator** to **BirthYear**. Map the **DeathYear** domain properity to their text decorator too.
297
297
298
-

298
+

299
299
300
300
4. Save the DSL, click **Transform All T4 Templates** on the **Build** menu, and press F5.
301
301
@@ -360,7 +360,7 @@ Generated material.
360
360
2. Rename **TownReferencesPersons** relationship to **Residence**.
361
361
3. Rename **Persons** on the left of Residence to **Residents**, and **Towns** to **Residences** on the ritght.
362
362
363
-

363
+

364
364
365
365
> [!NOTE]
366
366
> Reference relationships represent cross-references from one part of the model tree to another.
@@ -385,7 +385,7 @@ Generated material.
385
385
386
386
2. Use the **Diagram Element Map** tool to link the new connector to the relationship between Person and Town.
387
387
388
-

388
+

389
389
390
390
6. Create an element tool for making a new Town.
391
391
@@ -449,7 +449,7 @@ foreach(Person child in person.Children)
449
449
450
450
You can get Class Diagram to understand class structure and use it in the *.tt files. Right click the **DomainClasses.cs** (the subsidiary file of **DomainClasses.tt**) and then click the **View Class Diagram** command.
451
451
452
-

452
+

453
453
454
454
455
455
When you save the *.tt file, it will create a subsidiary file that contains the list of people and their residences. For more information, see [Generating Code from a Domain-Specific Language](../modeling/generating-code-from-a-domain-specific-language.md).
0 commit comments