Defining Domain Properties

By adding domain properties to a domain class, you can generate properties in the generated domain class. The added properties are displayed in the domain class, in the Domain Properties compartment. They can also be displayed in the generated Properties window and the generated DSL Explorer, and can be mapped to decorators on the design surface.

Adding Domain Properties

Add a domain property by right-clicking the domain class in the diagram, pointing to Add, and then clicking Domain Property. In the DSL Explorer, you can right-click the domain class, and then click Add New Domain Property.

Setting the Type of a Domain Property

To set the type of a domain property, select the Type property in the Properties window. A drop-down list displays the available types. For example, an Age property can have a type of Int32, and a Description property can have a type of String.

Calculated Domain Properties

Calculated domain properties are properties that have values that are calculated from the values of other domain properties or elements. To set up a calculated domain property, in the Properties window, set the Kind property to Calculated. You must then implement a GetXValue() method (where X is the name of the calculated property) in the class to which the property belongs. If you do not implement this method, the project will not compile. To enable the value to be set correctly, you must also implement the NotifyValueChange method. For more information about notifications, see Responding to Changes in the Model.

See Also

Reference

Properties of Domain Properties

Other Resources

Domain-Specific Language Tools Glossary