Inheritance
The relationship between a base domain element and a derived domain element is named inheritance. Domain classes, domain relationships, shapes, and connectors can have inheritance relationships. Inheritance is unlike embedding relationships and reference domain relationships because an inheritance relationship does not have explicit source and target elements, and it does not have properties. An inheritance relationship is represented on the diagram by a line that has a hollow arrow that points to the base element.
Before you can set inheritance between two domain relationships, there must already be an inheritance relationship between the two source domain classes and an inheritance relationship between the two target domain classes.
Procedures
To set inheritance between two domain classes
Create a domain model that has at least two domain classes.
In the Toolbox, select the Inheritance tool.
Drag the derived class to the base class.
Set the BaseClass property of the derived class to the name of the base class.
To set inheritance between two domain relationships
Create a domain model that has at least four domain classes, for example, Book, FictionBook, Author, and FictionAuthor.
Create two embedding relationships, as follows:
BookHasAuthor, which has source Book and target Author.
FictionBookHasFictionAuthor, which has source FictionBook and target FictionAuthor.
Make FictionBook inherit from Book by clicking the Inheritance tool and then dragging FictionBook (the derived class) to Book (the base class). Repeat this step to make FictionAuthor inherit from Author.
Make FictionBookHasFictionAuthor inherit from BookHasAuthor by clicking the Inheritance tool and clicking first FictionBookHasFictionAuthor (the derived relationship) and then BookHasAuthor (the base relationship).
See Also
Other Resources
Domain-Specific Language Tools Glossary
Change History
Date |
History |
Reason |
---|---|---|
July 2008 |
Rewrote and refactored project. |
Content bug fix. |