Attributes
With the properties of a class, TopLogic distinguishes between attributes and references. An attribute is a class property that represents a single value such as a number or a text. The value type of an attribute is described via a data type. By default, TopLogic already offers a large number of predefined data types that can be used as attribute types. The value type of the attribute determines, for example, which input field is displayed for the attribute in a form, or how a table column representing this attribute can be sorted or filtered.
Create attribute
A newly created class does not yet have any properties. A new attribute can be created in the class diagram by selecting the class and then clicking on the plus symbol in the toolbox that appears next to it.
In the dialog that opens, at least a technical name and a value type must be defined for the new attribute. The technical name of an attribute should begin with a lower case letter and consist only of letters without spaces or special characters. As with class names, compound words can be structured using capital letters in the word.
Selecting the value type
The value type can either be selected via the selector or you can type the beginning of its name and receive corresponding suggestions. The most important and most frequently used data types are defined in the module tl.core. See also the Data types section.
After confirmation, the new attribute is displayed in the class diagram with its name and value type. In the following example, two attributes have been created for the class RobotSystem, a name and a weight:
By default, the diagram does not use the technical names of classes and attributes, but their display names. This can be changed in the burger menu of the diagram.