Skip to main content

Naming concept for related field names and class names

When you add a reference relationship or derived relationship when defining a metamodel, the following names are automatically determined.

  • Source field name

  • Destination field name

  • Related class name

It is better to set the above names appropriately to clarify the intention and purpose of the defined relationship.

For example, if two reference relationships are defined from the "UseCase" class to the "Actor" class with the positioning of the main actor and the secondary actor, there is no way to distinguish them unless you change the related field name as shown below. *If the field name is duplicated, "_2" is automatically added.

In addition, the names of related classes are also automatically named, and it is not possible to distinguish them without knowing the purpose of each relationship.

Name the fields appropriately so that the intent and purpose of the defined relationships are clear, as shown below.

You can also toggle the display of relationship labels from the "Show Labels" in the "Class Diagram" group of the "Home" tab in the ribbon menu.

Similarly, give related classes appropriate names so that it is clear what the related classes are.

Supplement

If you change the class name of the source or destination after adding a relationship, the automatically named name will not be updated, so be careful when using the default name when adding a relationship.

For example, when adding a reference relationship from the "Port" class to the "Data" class, the "Data" field is added to the "Port" class, which is the source of the relationship, and the "_Port" field is added to the "Data" class, which is the destination of the relationship.

As shown below, even if you change the name of the "Data" class to "Variable" after adding a relationship, the name of the "Data" field of the source class will not be automatically changed.