Just like database modeling, entities can be normalized or denormalized. Normalizing a structure is the action of separating it into several related tables to reduce redundant data or empty fields. Denormalizing a structure is the opposite: we merge two or more tables together to simplify the structure and improve query performance, whilst adding redundant or empty fields. In this recipe, the entity was denormalized to allow different types of contacts to be surfaced through the same contact entity.
In step 1 to step 4, we added the existing contact entity to the Packt solution. Notice that in step 3, we had the option to either add the necessary assets or add all assets. For this recipe's simplicity, we added all assets. With the recent granular solution enhancements, we can simply add what is required.
It is a best practice to minimize the number of unnecessary attributes and relationships in a solution to avoid conflicts and dependencies.
In step 5 to step 7, we created the attributes, and in step 8 and step 9, we added the attributes to a new contact form. In step 10, we published the configuration we implemented.
To avoid multi-solution dependencies and scenarios where a form is overwritten with an updated version from another solution, best practice dictates that you create a new form for your solution and mark it as default. Unnecessary forms can always be hidden by using Apps as described in Chapter 9, Dynamics 365 Extensions.
Looking at the design of the updated entity, we have now configured the contact entity to fulfill more than one purpose: it is a generic contact as well as a student one.
A simplifiedEntity Relationship (ER) diagram is depicted in the following screenshot:
The advantages of a denormalized model are:
- Views will appear in the same combined list
- A quick and advanced find will include both types and display the results in the same list
- Positive form user experience, driven by the form configuration
The disadvantages of a denormalized model are:
- Security roles cannot easily be made specific to types
- Configuration/customization is required to show/hide irrelevant attributes or to mark them as mandatory or optional
- Records will contain blank fields when not applicable