Share via


Domain Models versus Models

A ___domain-specific language is defined by its ___domain model. The ___domain model includes the ___domain classes and ___domain relationships that form the basis of the ___domain-specific language. The ___domain model is not the same as a model. The ___domain model is the design-time representation of the ___domain-specific language, while the model is the run-time instantiation of the ___domain-specific language.

Domain classes are used to create the various elements in the ___domain, and ___domain relationships are the links between the elements. They are the design-time representation of the elements and links that will be instantiated by the users of the design-specific language when they create their models.

The following illustration shows part of the ___domain model of the Family Tree sample.

Family Tree Model

The illustration shows two Person ___domain classes plus a ParentRelation ___domain relationship. One of the roles in this relationship is Parent, which has a multiplicity of 0...* (which means that a parent may have any number of children or no children). The other role is Child, which also has a multiplicity of 0...* (which means that a child may have any number of parents or no parents). The Person ___domain class has two ___domain properties, Birth and Death, which are both integers. These properties are used to display the birth and death years on the Person element.

Note

There are only four multiplicities (0...*, 1...*, 1...1, and 0...1), but you can further restrict the occurrences of a given element by using constraints.

When you compile the Family Tree sample project and run it in Visual Studio, you can create a Family Tree model. The following illustration shows part of a Family Tree model of the Tudor family.

Tudor Family Tree Model

The illustration shows three instances of the Person ___domain class, Henry, Mary, and Elizabeth. Henry has a ParentRelation relationship with both Mary and Elizabeth. Henry has a Birth property of 1491 and a Death property of 1547.

See Also

Other Resources

Domain-Specific Language Tools Glossary

Change History

Date

History

Reason

July 2008

Rewrote and refactored project

Content bug fix.