Modeling elements and fields
Every enterprise application relies on data concepts to store and exchange information. In Normalized Systems, these concepts are modeled as Data Elements, representing the software equivalent of your business objects. We will now create the three data concepts we defined in our euRent business requirements: Car, Person, and Booking.
Creating new data elements
To create the first data elements for the euRent system:
In the Micro Radiant editor, select our primary business component, rentWork. Next click the component's menu and select the New DataElement option.
Configuring the data element structure
For each Data Element, you must specify a Name, a Package, and a Type. The Package organizes the generated code structure, while the Type defines the element's fundamental role (e.g., Primary is used for core entities).
Use the following specifications to create all three Data Elements sequentially:
| Name | Package | Type |
|---|---|---|
| Person | com.nsx | Primary |
| Car | com.nsx | Primary |
| Booking | com.nsx | Primary |
Adding attributes to an element
After creating the Data Elements, the next step is to define the individual pieces of information, known as Fields. For the Car element, we need to capture the vehicle's identifying attributes (e.g., a Mercedes CLA with plate ABC-123).
- Click the newly created Car Data Element to open its detailed editor screen.
- Choose the New Field option.
When defining a Field, you are presented with several options:
- Name: The descriptive name to identify the field (e.g., brand).
- Add to info: If checked, this field will be included when listing or showing summary information for the element.
- ValueField / LinkField: Determines if the field stores a direct value (ValueField) or a relationship to another Data Element (LinkField).
- Type: The data type of the input (String, Integer, Date, etc.). This dictates the validation applied to user input.
- Picklist: If checked, the user will be presented with a predefined list of values instead of free text input.
Add the following three ValueFields to the Car Data Element:
| Name | Add to info | ValueField | Type | Picklist |
|---|---|---|---|---|
| brand | ✅ | ✅ | String | ✅ |
| model | ✅ | ✅ | String | |
| numberplate | ✅ | ✅ | String |
Note that for brand, we have checked Picklist. This indicates that we will later define a specific list of car manufacturers that users can select from, ensuring data consistency.
Adding attributes to Person and Booking
Following the same process as above, add the specified Value Fields for the Person and Booking Data Elements.
Person Value Fields
| Name | Add to info | ValueField | Type | Picklist |
|---|---|---|---|---|
| firstName | ✅ | ✅ | String | |
| lastName | ✅ | ✅ | String | |
| birthDate | ✅ | ✅ | Date |
Booking Value Fields
| Name | Add to info | ValueField | Type | Picklist |
|---|---|---|---|---|
| startDate | ✅ | ✅ | Date | |
| endDate | ✅ | ✅ | Date | |
| bookingNumber | ✅ | ✅ | Integer |