Domain Model Types and Classes

The distinction between a domain model type and a domain model entity or class is explained elsewhere. 

Here we are concerned with how we add them to the current model’s domain data model. First navigate to the data model itself, by lciking on the top-level node ‘Domain data model’ in the tree view control at the left of the main window. This right hand panel will now be populated with a list of the entities and types known about in the model:

Listing existing types and classes

Note that the grid contains three columns. The left column gives the type or entity name. The middle column gives a description of the corresponding entity or type. The right column has a checkbox to indicate whether the item is an entity or a type. The presence of a tick means it is an entity (or class in object-oriented terminology). The absence of a tick means it is a simple type.

Adding Types and Classes

To add a new type or class to the domain data model, select Edit | Add class from the main menu, or click the ‘Add class’ button on the toolbar as indicated by the red arrow in the screenshot below. This will cause a new class or type to be created with the name ClassOrTypeN where N is a possibly absent number. This is unlikely to be the type name you want, so you should change it to a meaningful class or entity/class name immediately:

Adding a new type

Once you have changed the name of the type or entity, provide a meaningful description of it in the description box. Typical things that go into this description might be: the meaning or interpretation of the type; the circumstances under which it might be created or deleted as a data item; any constraints or dependencies imposed on its possible data values; qualifying statements about particular interpretations that have led to misunderstandings about its values in the past; etc.

If the type is a simple type with no further decomposable structure, leave the ‘Type’ radio button selected.

If the type is really an entity or class, for which you will need to define further nested members making it into a compound data type, click the ‘Class’ radio button instead. Two grids will now appear at the bottom of the editing panel where the nested data members and other entities involved in relationships with this entity will ultimately be listed:

Adding a new class

Editing Types and Classes

To edit a type or a class, you first need to select the type or class (entity) you want to edit. From the tree view at the left of the main window, click the ‘+’ alongside the top level node named ‘Domain data model’ to see the list of types and classes known about by the model. Now click on one of the type or class names from the list, and the right panel will be populated with the editing panel for that type or class. The content can then be edited as described in the ‘Adding Types and Classes’ section above.

Deleting Types and Classes

To delete a type or class/entity from the data model, navigate to it in the tree view, by expanding the node labelled ‘Domain data model’. On expansion, the list of types and entities will appear beneath this node. Select the name of the type or class you wish to delete, then select Edit | Delete class from the main menu, or click the corresponding button on the toolbar as shown in the screenshot below:

Deleting a type or class

A dialog may appear warning you that you are about to delete a class or type. This is because your element might have references to it made from other parts of the model. For example, it might be at one end of an association in the model, which would cause the association to disappear as well.

Once your class or type has been deleted, the tree view will collapse and then select the ‘Domain data model’ node, thereby producing the grid of types and entities as the right hand panel of the use interface.