Build a Domain Specific Language with DSL Tools concluded (Page 1 of 6 ) Last week, we generated and built a business entity designer by way of introducing you to building a Domain Specific Language with DSL tools. This week, we'll run the designer and look at its features. We'll also learn how to do tasks such as adding a new property, introducing notation for the new property, and more. Run the Business Entity Designer
- Now that the designer is generated and built, let’s take a quick look at some of its features.
- Press Ctrl-F5 to run the designer. This will bring up a second instance of Visual Studio with a project open named “BizEntityDebugging”.
- Notice that there is a file named “Empty.biz” included in this project. Double-click to open that file in your designer. Your designer will look like this:

To get a feel for how the designer works, drag two Entity shapes from the toolbox onto the blank diagram surface. To do this, left-click on the Entity tool, hold the mouse button down and drag to the document area, and release. Click on the Association tool in the toolbox. Click on the first entity shape you added, then on the second shape to draw an association line between them. The result should look something like this:
Notice that our notation defines a shape which corresponds to an Entity in the domain model, and a connector line which corresponds to an association between entities. Feel free to explore the target designer a little more at this point. Some things to try: Double-click on the NewEntity text in the shape header to rename it using in-place editing. Right-click on the shape header and select Add->Attribute from the context menu to add a new attribute to the shape. Note that according to our notation, attributes on entities are placed in a compartment within the entity shape. Click on the association line, and set the SourceMultiplicity and/or TargetMultiplicity properties from the property grid. Note that the labels on the diagram lines are updated to match.
When you’re finished, close the designer by selecting File->Close from the main menu. When prompted, do NOT save changes to the “Empty.biz” file, because we are going to modify the domain model in the next task, which will result in a change to the format of this file. Close the second IDE by selecting File->Exit from the main menu.
Next: Add a New Property >>
More BrainDump Articles More By MSDN Virtual Labs |