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.