Freigeben über


How to: Add a Reference Relationship to a Domain-Specific Language Definition

You use domain relationships to establish relationships among domain classes in a domain-specific language definition. You can establish two kinds of domain relationships between domain classes. One of them is called a reference relationship, which you can create from the Toolbox in the Domain-Specific Language Designer. For more information, see Embedding and Reference Domain Relationship (Domain-Specific Language Designer) and Overview of Domain Relationships.

To add a reference relationship to a domain-specific language definition

  1. In the Toolbox, on the Dsl Designer tab, click the Reference Relationship connector.

  2. Drag the connector so that it appears between two established domain classes on the diagram. Or, click one class and then click the other class to connect them.

    Hinweis

    The pointer changes to a prohibitory sign if the connection points are not valid.

    For more information, see How to: Add a Domain Class to a Domain-Specific Language Definition.

    When you create a domain relationship, it appears in the domain-specific language definition under the Classes and Relationships swimlane. The relationship is defined with established roles that you can customize. The roles named DomainClass1 and ExampleMo… (ExampleModel) in the following illustration include multiplicities, shown as 0..*, which you can modify in the Properties window.

    Domain Relationship with Roles

    ref relationship

    You can also add domain properties to a domain relationship. For more information, see How to: Add a Domain Property.

See Also

Concepts

Defining Classes and Relationships

Domain-Specific Language Designer Terminology Overview

How to: Add a Domain Relationship (DSL Explorer)

Domain-Specific Language Tools Glossary