Question
click below
click below
Question
Normal Size Small Size show me how
Mendix Intermediate
Expand Your Domain Modeling Skills
Question | Answer |
---|---|
Associatie | These associations allow you to create possible connections between objects. Also Reference |
Welke 3 type associaties zijn er? | 1. One-to-Many (1 - *) 2. One-to-One (1 – 1) 3. Many-to-Many (* - *) |
Single Associaties between entities | There was always only 1 association between 2 entities. For example: a single One-to-Many association between Teacher and Training Event. |
Wat is de belangrijkste reden om meerdere associaties te hebben tussen 2 entiteiten? | Because you can have different relations between instances of entities. A company could for example wish to store two addresses for customers: one shipping address and one invoice address. |
Using a One-to-Many association versus multiple One-to-One associations also impacts | the way the end user can set certain connections. |
The before event handler | use it as a trigger for a validation process, right before committing the object to the database |
The before event handler returns | a Boolean Return Value |
Waarvoor zou je een Before commit kunnen gebruiken in het stadion voorbeeld? | You could also use a before commit event handler to connect a Match to a Stadium based on the home team, before committing it. |
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. |
Persistable property | Defines whether an object can be stored in the database. When an entity is declared persistable, a database table is created for this entity. Committing an instance of such an entity results in a row being inserted into this table. |
Non-persistable entities | cannot be stored in the database and hence have no associated database table. |
Wat gebeurd er als je een non-persistable toch commit? | While it is possible to commit a non-persistable entity, the commit only stores the current attribute values and association values in memory, not in the database -> data deleted at the end of the session |
Transient object | When an object is created, this is done in memory. This means the object at this point only exists in memory and not in the database. This is what is called a transient object. |
Wat is een Non-persistable associatie? | When you create an association between a non-persistable and a persistable entity, the ownership of the association (the side with the dot) must always lie only at the side of the non-persistable entity. This means that there are two possible associations |
Wat zijn andere limitaties bij het gebruik van non-persistable entiteiten? | They can’t have validation rules on the Domain Model and can’t have indexes (as this is a database feature). |
Why use non-persistable entities? | Well sometimes data just shouldn’t end up in the database. This could be because it is process data (connected to a transaction), or because it is sensitive information, that by law can’t be stored. |
The bottom line by using a non-persistable entity | the bottom line is: if objects don’t belong in the database, they should be a non-persistable entity! |
Wat zijn System Members? | store createdDate store changedDate store Owner store changedBy |
Calculated Attribute | is defined in the domain model and gets its value the moment it is accessed. The value of the attribute is determined using a chosen microflow |
Minimize the use of calculated attributes | as they fire on every retrieve and per row for a list retrieve -> could hurt the performance of the app |
Wanneer is het een goed idee om een Calculated attribute te gebruiken? | 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. |
You can recognize a calculated attribute in the Domain Model | by the little microflow icon it has behind its name |
Where do you define the "persistable" property of an entity? | In the domain model |
For which of the following entity types does Mendix create a database table? | For persistable entity |
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 |
Cross-module associations | In Mendix you can divide your app into several modules, which is usually done on a functional level. |
Welke 3 standaard modules heeft elke app? | System, Administration, and MyFirstModule. |
System Module | is what makes your app run, it contains the basic data structure that every app needs: users, files, sessions, etc. This module is off-limits, meaning that you as a Mendix developer can’t change the contents of this module |
Administration Module | Is the module that allows users to have and manage accounts. |
MyFirstModule | is the module where you start building your app |
Now let’s say Adrian wants players to be able to have an account. You can achieve that by.. | creating a cross-module association from FootballPlayer to Account |
Hoe kan je naar de entiteit gaan die in een andere module zit? | When you right-click the association, you get the option to Go to other side, this will take you to the associated entity in the other module. Another way to go about this is by making the Player entity inherit from the account entity. |
System Members | System members is information about objects you can store in the database. |
Welke 4 System Members zijn er? | 1.createdDate 2.changedDate 3.owner (user that created the object) 4.changedBy |
By default, this information isn’t stored in the database. Waarom is dit? | This is because with a lot of objects, you don’t really need this information and the Modeler doesn’t want to unnecessarily clutter your database. |
When connecting 2 entities of 2 different modules how do we typically call that association? | Cross-module association |
You connected two entities by a cross-module association. You want Studio Pro to take you to the associated entity in the other module - which option do you need to choose when you right click the association? | Go to the other side |
Which of the following options list system members that can be stored as indicated in the properties of an entity? | Created Date, Changed Date, Owner, ChangedBy |
Which of the following terms is used to indicate a user that created the object of the given entity? | Owner |