Share via


Derived Classes and Derived Relationships Overview

A domain model can have an unlimited number of domain classes and domain relationships. These domain classes and domain relationships are referred to as elements when you create them by using the Domain-Specific Language Designer. You can derive any of these elements in the generated designer, as shown in the following illustration. You can use a derived type when the base is expected. Derived types can have not only method or property members but also additional custom behavior, which includes properties that are not in the base. The following illustration is based on the Library domain model. For more information, see Library.Dsl Overview.

Derived Elements and Derived Relationships

derived elements

The illustration displays the following concepts:

  1. The Person domain class.

  2. The Book domain class.

  3. The PersonChecksOutBook domain relationship.

  4. The Student domain class.

  5. The CirculationBook domain class.

  6. The StudentChecksOutCirculationBook domain relationship.

  7. The Student domain class is derived from the Person domain class.

  8. The CirculationBook domain class is derived from the Book domain class.

  9. The StudentChecksOutCirculationBook domain relationship is derived from PersonChecksOutBook domain relationship.

Note

The structure of the derived relationship must be consistent with the structure of the base relationship.

See Also

Concepts

Domain Models Overview

Domain Relationships Overview

Adding Validation to Domain-Specific Language Solutions

Generating Artifacts By Using Text Templates

Understanding the Generated API

Domain-Specific Language Tools Glossary