Data modeling (UML)

The Novulo applications are composable and integrate in “design time”. The data model is also built up based on the components. This ensures that the data models between Novulo applications can differ: there is not one data model.

However, all applications integrate based on a “reference architecture”. This is a standard drawn up and managed by Novulo for a data model, which all components use. As a result, the basis for all users of comparable functionality is the same, while specific functionality may differ per application.

The database is generated from the application model, so the database is based on the pages and their user interface elements (grids, forms, fields). Every time you add/update a page/grid/form/field – you create/update a data table. Every page will be a database table, and every user interface element on that page will appear as a data field in that table. When a user fills in a form on a page and presses “Add”, it will add a new record with that data into that table.

NB! Dummy and Never editable fields are not saved in the database. They are temporarily memorized in the page state.

UML in Architect

You can overview a data model in Architect: open a component > go to the UML tab > right click > click update > you will see all concepts, features, and relations within a data model.

Tip! Be attentive to names that you give to your grids/forms/fields, especially when you consume a concept > create a virtual page > add a form/field(s). If the form will use an existing name (for example, “Settings”), any field(s) you add to it will be “merged” to the existing “Settings” form. But if a form name will be new and unique > it will appear as a new form under the “More” menu.

Data connections by linking pages and grids

A standard situation is a grid page with “Add” and “Delete” buttons (for example, “All boxes”) and a link with a details page (“Box”). It will create a table in the database, based on the user interface elements on the details page. There are no references to other tables in this example.

image
image

But when we add a grid “Box contents” on the Box page and create a details page for Box content (with a form), then a database connection appears. For every box, a unique ID is stored with every record from the Box contents table, so the database knows which box content records belong to which box.

image
image

Every record in BoxContents has a relation with a unique box (mean: BoxContent belongs to a (parent) Box). There cannot be box content without a box, but a box can have one or more box content records (“has many” relation).

Database connections using a search link or dropdown

For example, you have a separate module to maintain all contact information, but you want to add a specific contact to each box on the box page. In this case, you need to add a search link on the Box page > go to properties > data source tab > choose a model you want to create a link to (Contact in our example) > choose a value that will be shown in the search link. So you will have a link (relation) between a contact data and a box data, but you can manage all Contact details on the page specifically designed for it (and structured in the Contact module).

image

What this implies in the data model is that every box stores a “foreign key” to relate to a unique data record in a different table. In the example above the used key is called “contact”. This means a box can only have one contact, but a contact can be added to multiple boxes.

Database connections using a link table

Imagine having a school system, in which you have a module with several pages to maintain information about Students and a module for Classes. In this situation we want to (un)subscribe a student to several classes. From a database perspective, these objects exist on their own but these two objects can be linked. Students can have multiple Classes and Classes can have multiple Students. In this situation it is the best to create a link table (bridge model).

We can add a separate module to maintain Class attendance under which we make a page with two search links. One search link is connected to the Students page, the other to the Classes page.

image

The assignment page has two search links:


image