Working with the DSL Definition Diagram
The diagram of a Domain-Specific Language Tools definition is an important tool for defining the domain-specific language. You can add elements to your domain model and define relationships on the diagram, and you can modify the layout of the diagram to make it more readable.
The Domain-Specific Language Tools definition diagram has two partitions, the Classes and Relationships partition and the Diagram Elements partition. The Classes and Relationships partition displays domain classes, domain relationships, and inheritance. The Diagram Elements partition displays shape classes, connector classes, swimlane classes, and the generated designer diagram.
Domain classes can appear in multiple locations in the Classes and Relationships partitions. A domain class definition displays an inheritance tree if it is the base class for other domain classes, and a relationships tree if it is the source of embedding or reference relationships. Domain class placeholders appear as the targets of embedding or reference relationships. By default, placeholder elements are displayed with the Domain Properties compartment collapsed. They do not show inheritance, or embedding or reference relationships.
When you add a domain class, it appears in the lower part of the Classes and Relationships partition. When you add an embedding or reference relationship, it is drawn under and to the right of the source domain class.
As you add domain classes and relationships, it may become difficult to locate a particular domain class. You can find a domain class by right-clicking it in the DSL Explorer and then clicking Locate in Diagram.
The following sections describe how you can change the appearance of the diagram to make it easier to read.
You can change the layout of the Classes and Relationships partition as follows.
If a domain class plays the source role in embedding or reference relationships with other domain classes, you can hide the relationships by right-clicking the domain class definition and then clicking Collapse Relationships Tree. To show the relationships, right-click the definition element and then click Expand Relationships Tree.
You can consolidate the diagram by right-clicking a placeholder domain class and then clicking Bring Tree Here. The placeholder domain class becomes a definition element and displays the inheritance and relationships trees. The former definition element becomes a placeholder element if it is the target of a relationship or the child in an inheritance relationship; otherwise, it disappears.
You can break out inheritance or relationships trees by right-clicking the domain class definition that displays them and then clicking Split Tree. The definition element becomes a placeholder element, and the definition domain class, together with its inheritance and relationships trees, is now displayed at the bottom of the partition.
If a domain relationship has derived relationships, or if it has embedding or reference relationships with other domain relationships, you can display the relationship as a class by right-clicking the relationship and then clicking Show As Class. The relationship will be displayed with a Domain Properties compartment and will show the inheritance and relationships trees.