Microsoft domain specific language dsl tools
Make sure that a check mark appears next to the name of the decorator. Under Displayed elements collection path , navigate to the list element class Song. Click the drop-down arrow to use the navigator tool. Under Display Property , select the property that should be displayed in the list.
In the example, this is Title. By using the Path fields in the Decorator Map and Compartment map fields, you can make more complex relationships between the domain classes and the compartment shape. Copy and paste one of the existing element tool.
BMP files. Right-click the header of the new shape, and then click Add Your List Item. In the example, the command is Add Song. Click one of the list items, and then examine the Properties window. You should see the properties of the list items. Open the language Explorer. Verify that you can see the container nodes with the list item nodes inside. After you first test a compartment shape, you might want to adjust some of its properties and add some more advanced features.
Usually, an element that you display in a compartment is a child of the element that is represented by the compartment shape.
But sometimes, you would like to display an element that is linked to it with a reference relationship. For example, we could add a second compartment to AlbumShape that displays a list of the Artists that are linked to the Album. In this case, the compartment should display the link, instead of the referenced element. This is because when the user selects the item in the compartment and presses DELETE, you want the link to be deleted, not the referenced element.
The following procedure assumes that you have already created the domain class, the reference relationship, the compartment shape, and the diagram element map, as described earlier in this section.
Add a compartment to the compartment shape. Set Displayed elements collection path to navigate to the link, instead of its target element. Click the drop-down menu and use the tree view to select the reference relationship instead of its target. In the example, the relationship is ArtistAppearedOnAlbums.
Set Path to Display Property to navigate from the link to the target element. In the example, this is Artist. Set Display Property to the appropriate property of the target element, for example Name. In the model diagram, create the appropriate classes of shape, set their names, and create a link between them. In the compartment shape, the names of linked elements should appear.
Select either the link or the item in the compartment shape. Both the link and the item should disappear. Ports can also be used to provide a fixed connection point on another shape, to which the user can draw connectors. In this case, you can make the port shape transparent. To see an example that uses ports, select the Component Diagram template when you create a new DSL solution. This example shows the main points that you can consider when you define ports:. There is a domain class that represents ports.
In the example, this is ComponentPort. There is an embedding relationship from the container domain class to the port domain class. For more information, see Defining Domain Classes. If you want different types of port to be mixed on the same container, you can create subclasses of the port domain class. The container domain class can be mapped to any kind of shape.
In the example, it is ComponentShape. For more information, see Defining Shapes. The port domain classes are mapped to port shapes. You can either map the derived classes to separate port shape classes, or map the base class to one port shape class.
In other respects, port shapes behave as described in Defining Shapes. For more information, see Properties of Port Shapes. Swimlanes are a horizontal or vertical partition of a diagram. Each swimlane corresponds to a model element.
Your DSL definition requires one domain class for the swimlane elements. Rename this and the other classes to suit your project.
To add a class that will be displayed as a shape inside a swimlane, create an Embedding Relationship between the swimlane class and your new class. Users will be able to drag elements from one swimlane to another, but each element will always be inside a particular swimlane. In the Task Flow solution template, FlowElement is a child of the swimlane class.
To add a class that will be displayed as a shape independently of swimlanes, create an Embedding Relationship between the root class and your new class. Users will be able to place these shapes anywhere on the diagram, including across the boundaries of swimlanes and outside the swimlanes. In the Task Flow solution template, Comment is a child of the root class. For more information, see Properties of Swimlanes.
This element does not appear on the diagram. To add enumeration literals to the domain enumeration, right-click the domain enumeration in the DSL Explorer and then click Add New Enumeration Literal. By default, a property that has an enumeration type can be set to only one value of the enumeration at a time. If you want users and programmers to be able to set any combination of values - a "bit field" - set the IsFlags property of the Enumeration.
When you set the type of a domain property, if you do not find the type you want in the Type drop-down list, you can add an external type. For example, you could add the System. Color type to the list. In the Properties window, set the name to Color and the namespace to System. You can choose it whenever you set the type of a domain property. Using the techniques described in this topic, you can quickly create a DSL with a diagrammatic notation, a readable XML form, and the basic tools that are required to generate code and other artifacts.
For example, you can make a single connector tool that can create several types of connector, and you can control the rules by which deleting one element also deletes related elements. These techniques are mostly achieved by setting values in the DSL Definition, and some require a few lines of program code. Extend your modeling tools by using program code to achieve more advanced effects. For example, you can create menu commands that can change the model, and you can create tools that integrate two or more DSLs.
When you create any item in a DSL definition, many default values are set automatically. Code is generated from this value. It must be valid as a C class name. Verify that this file extension has not already been registered for use in this computer, as follows:. Look under Other tools and applications registered to handle this extension.
If you see the message No applications or Visual Studio editors use this extension , then you can use this file extension. Reset the Visual Studio Experimental Instance. This will unregister all of the DSLs that you have previously built. You can rebuild any other DSLs that you want to use again. If a Visual Studio Extension that uses this file extension has been fully installed on your computer, uninstall it.
What is the name of the product that the new domain-specific language belongs to? Defaults to the DSL name. This value is used in Windows Explorer or File Explorer to describe files that have this file extension. What is the root namespace for projects in this solution? The tools help you define the domain-specific language and generate the code of a graphical designer for you. Read more. There are inherent dangers in the use of any software available for download on the Internet.
You are solely responsible for adequate protection and backup of the data and equipment used in connection with using software Microsoft Domain-Specific Language DSL Tools. Download Homepage Report Error. Link to us Submit Software. Privacy policy. Unlike a general-purpose language such as C or UML, a domain-specific language DSL is designed to express statements in a particular problem space, or domain.
Each DSL is much better than a general-purpose language for describing operations on text strings or a database, but much worse for describing ideas that are outside its own scope.
Individual industries also have their own DSLs. For example, in the telecommunications industry, call description languages are widely used to specify the sequence of states in a telephone call, and in the air travel industry a standard DSL is used to describe flight bookings.
Your business and your project also deal with special sets of concepts that could be described with a DSL. For example, you could define a DSL for one of these applications:. When you design a DSL, you define a domain class for each of the important concepts in the domain, such as a web page, lamp, or airport check-in desk.
You define domain relationships such as hyperlink, wire, or a conveyor belt to link the concepts together. Users of your DSL create models. Models are instances of the DSL. For example, they describe a particular website, or the wiring of a particular device, or the baggage handling system in a particular airport.
Your users can view a model as a diagram or as a Windows form. Models can also be viewed as XML, which is how they are stored. When you define a DSL, you define how the instances of each domain class and relationship appear on the user's screen. A typical DSL is displayed as a collection of icons or rectangles connected by arrows.
0コメント