Expand Your Domain Modeling Skills Flashcards
What is another way of calling an association?
Reference.
How many associations can you add between two entities?
Many associations of various multiplicity.
What is a good reason to choose to use an Information Entity instead of multiple associations?
You want to display additional information about an association.
Which of the event handlers does always need to return a boolean return value?
The before commit.
When an entity is declared persistable what happens in terms of database operations?
When an entity is declared persistable a database table is created for that entity. Committing an instance of such an entity results in a row being inserted into this table storing attribute and association information in the database.
What is the fate of non-persistable entities in terms of database storage?
Non-persistable entities cannot be stored in the database and have no associated database table. While it is possible to commit a non-persistable entity the commit only stores the current attribute and association values in memory not in the database. This information is garbage collected at the end of the session.
What is a transient object in Mendix?
A transient object is an object created in memory that exists only in memory and not in the database. When an object is created the database is not accessed except for retrieving AutoNumber information if attributes of this type are present.
In associations between non-persistable and persistable entities where does the ownership of the association lie?
In associations between non-persistable and persistable entities the ownership of the association must always lie on the side of the non-persistable entity.
How can you visually identify whether an entity is persistable or non-persistable without opening the properties screen?
You can identify whether an entity is persistable or non-persistable by looking at the color of the entity. Non-persistable entities have a different color.
What are some limitations of non-persistable entities in Mendix?
Non-persistable entities in Mendix cannot have validation rules on the Domain Model and can’t have indexes as these are features associated with the database.
Why would you use non-persistable entities despite their rules and limitations?
Non-persistable entities are useful when certain data should not be stored in the database. This could be due to data being process-related connected to a transaction or sensitive information that by law cannot be stored. Non-persistable entities ensure that such data cannot be committed to the database avoiding unnecessary table creation and clutter in the database.
What is a calculated attribute in Mendix?
A calculated attribute is defined in the domain model and gets its value the moment it is accessed. The value is determined using a chosen microflow which is executed at every subsequent retrieve of the attribute ensuring the value is always up-to-date.
Why is it recommended to minimize the use of calculated attributes?
It is recommended to minimize the use of calculated attributes because they execute a microflow on every access of the entity impacting performance. Additionally these values cannot be used directly when querying the database.
What is the downside of using calculated attributes in terms of database querying?
Calculated attributes cannot be used directly when querying the database since their values don’t exist in the database.
Why should you try to store derived values in the database rather than using calculated attributes?
Storing derived values in the database is recommended to improve performance. Using event handlers to automatically commit new derived values when they change is a best practice to achieve this.
When is it appropriate to use a calculated attribute?
It is appropriate to use a calculated attribute when a value changes very often. The rule of thumb is: If it changes more than you look at it use a calculated attribute. If you look at it more often than the value changes store it in the database.
How can you recognize a calculated attribute in the Domain Model?
A calculated attribute in the Domain Model can be recognized by the little microflow icon it has behind its name.
For which of the following entity types does Mendix create a database table?
For persistable entities.
What happens on commit of a non-persistable entity?
Current attribute values and association values are stored in memory.
What would be a good situation to use a calculated attribute?
When a value changes more often than it is viewed.
Where can you define cross-module associations in Mendix?
In the Domain Model.
What is the purpose of dividing an app into multiple modules in Mendix?
To organize the app on a functional level. The System module contains basic data structures the Administration module manages accounts and other modules are used for building the app.
What is the System module in Mendix and what does it contain?
The System module is essential for running the app and contains basic data structures such as users files and sessions. It is off-limits meaning developers can’t change its contents.
How can cross-module associations be useful in Mendix?
Cross-module associations allow you to connect data from different modules enabling relationships between entities in separate modules.