Share via


How to: Add a Connector to a Domain-Specific Language Definition

You can use connectors to specify how domain relationships appear in a generated designer as lines (for example, what color and dash style that the line will display). For more information, see Connector (Domain-Specific Language Designer).

To add a connector to a domain-specific language definition

  1. In the Toolbox, on the Dsl Designer tab, drag a connector onto the diagram surface of the Domain-Specific Language Designer.

    A connector that is named Connector1 is created in the designer definition under the Diagram Elements swimlane.

  2. Optionally add decorators, such as text and an icon, to the connector. For more information, see How to: Add a Decorator.

  3. Optionally, add domain properties to the connector. For more information, see How to: Add a Domain Property.

  4. Set any properties in the Properties window.

    For example, you can change the default value of the Color property from black to red and the DashStyle property from solid to dash.

  5. Map the connector to the domain relationship (embedding relationship or reference relationship) using the Diagram Element Map tool. For more information, see How to: Map Elements By Using the Diagram Element Map Tool.

  6. Create a connection tool using the DSL Explorer. For more information, see How to: Add a Connection Tool.

    Click Transform All Templates in Solution Explorer.

  7. On the Build menu, click Rebuild Solution to start a Visual Studio experimental build to display how the connector has been defined and mapped to a domain relationship.

See Also

Concepts

Domain-Specific Language Designer Terminology Overview

Walkthrough: Creating a Domain-Specific Language Solution

Defining Diagram Elements

How to: Add a Connector (DSL Explorer)

Domain-Specific Language Tools Glossary