How to: Add an Embedding Relationship to a Domain-Specific Language Definition

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

To add an embedding relationship to a domain-specific language definition

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

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

    Note

    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.

    The domain relationship is created 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, which are shown as 0..* and 1..1. You can modify these multiplicities in the Properties window.

    Domain Relationship with Roles

    embedding 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