- Builder
- Data Types in Codejig Builder
Data Types in Codejig Builder
There are primitive and composite data types in Codejig Builder. Primitive types are used as basic building blocks. Composite types are constructed recursively from primitive types without inheritance. For example, there are primitive types STRING and INTEGER from which one can create composite types Person and Team like follows:
Person |
|
Field name |
Field type |
Name |
STRING |
Age |
INTEGER |
Team |
|
Field name |
Field type |
Club name |
STRING |
Coach |
Person |
Wins |
INTEGER |
Team data type uses Person type in its definition.
The data types are dived into 7 different “kinds” (type families): Primitive, Directory, Report, Transient, Embedded, Document and Register. Each type kind has its unique features and purpose. You can read more about each kind in sections Primitive Data Types and Composite Data Types. Type kind is chosen during data type creation and can not be changed later.
In the above example field “Club name” contains a space character in its name. Usage of space character would be forbidden in most of text based programming languages but it is perfectly legal in Codejig Builder. Both type and field names can contain any character that can be typed from the keyboard and there is no practical limit on name length. Furthermore, type and field names are translatable and this feature is used actively during localization of applications made with the Builder. Type and field names can be edited at any moment without impact on existing code or views. Internally Builder assigns a unique number to each type and field and uses it whenever type or field is referenced. While handling of field names is very flexible, it is not possible to change the field type in the very same way. If you have chosen a wrong type during field declaration, just create a new field with correct data type, reset all references from old field to the new field and delete the old field.