Share via


How to: Add a Domain Property

Domain properties represent individual data points that describe aspects of domain classes in a domain-specific language, for example, a due date in a library class. You can add domain properties to the following diagram objects:

  • Domain Class

  • Geometry Shape

  • Compartment Shape

  • Image Shape

  • Port Shape

  • Swimlane

  • Connector

  • Domain Relationship

  • For example, the following illustration shows a domain class that has some domain properties.

Domain Class with Sample Domain Properties

dsl domain class properties

For more information about the property settings that are available for domain properties, see Domain Property (Domain-Specific Language Designer).

The following procedures demonstrate how to add domain properties by using the Domain-Specific Language Designer and DSL Explorer.

To add a domain property to an element in a diagram

  1. Right-click the name of the object in the diagram, point to Add, and then click DomainProperty.

    A new domain property appears under a Domain Properties heading in the object.

  2. Type a name for the domain property.

  3. In the Properties window, modify the Type property for the new domain property. You can set this property to any of the following values:

    • Boolean

    • Byte

    • Char

    • DateTime

    • Double

    • Guid

    • Int16

    • Int32

    • Int64

    • Sbyte

    • Single

    • String (Default)

    • UInt16

    • Uint32

    • UInt64

  4. Modify any other properties to meet your requirements.

To add a domain property to an element by using DSL Explorer

  1. In DSL Explorer, right-click the object to which you want to add the domain property, and click Add New DomainProperty.

    A new domain property appears listed under a Domain Properties heading in the object.

  2. In the Properties window, set the value of the Name property by typing in a name for the new domain property.

  3. Modify the Type property for the new domain property. You can set this property to any of the following values:

    • Boolean

    • Byte

    • Char

    • DateTime

    • Double

    • Guid

    • Int16

    • Int32

    • Int64

    • Sbyte

    • Single

    • String (Default)

    • UInt16

    • Uint32

    • UInt64

  4. Modify any other properties to meet your requirements.

See Also

Concepts

Defining Classes and Relationships

Domain-Specific Language Designer Terminology Overview

Defining Calculated Properties

Working with Domain Properties

Domain-Specific Language Tools Glossary