"Diamond" File Structures
Data-dictionary structures can support "diamond" relationships. A diamond relationship is one where a parent file can be reached from a child file by more than one path. Consider the following example:
A B C
\ / \ /
D E
\ / \
F I
/ \ /
G H
In this example, there are two diamond relationships (Files B and E are the tops of each diamond). When File F finds a record, there are two paths it can use to find related Parent B (F → D → B or F → E → B). This kind of structure is supported as long as the relationships are proper. If Record B can be reached by two paths, then you must make sure that the record that will be found in B will be the same using either path. In other words, the records in D and E must have the same parent in B. Similarly, the records in F and I must have the same parent in E. As long as these rules are obeyed, diamonds are fully supported. The updating structure of your data dictionaries should reflect the diamond structure. The redundancy in updating links will not cause any problems; DDOs will take this redundancy and optimize it.
Summary
It is critical that you understand how data-dictionary operations behave and propagate. If you do, you can accurately predict how your views will behave. Below is a summary of the data-dictionary operations and their behaviors.
| Data-Dictionary Operation | Normal Behavior | Constrained Behavior |
|---|---|---|
| clear_all | Clears all connected DDOs | same |
| clear | Clears DDO and all updated DDOs. Propagates up. | Clears DDO and all updated DDOs unless a relates-to constraint is encountered. The clear up that branch will be halted. Child DDOs with a relates-to constraint are notified of the new blank record. It will clear or find as required. |
| request_save | Saves DDO record and updates all parent-file DDOs. Propagates up. | same |
| request_delete | Deletes DDO record and updates all parent file DDOs. Child records are deleted if their DDOs update the parent DDO and cascade_delete_state is true. Propagates up and (conditionally) down. | same |
| finding | Finds record for the requested file. A relate is performed. All DDOs are notified of the change, setting each DDO's current_record as needed. Any DEO that uses any affected DDO is refreshed. | If the file’s DDO has a relates-to constraint in effect, only records will be found that satisfy the constraint's requirements. Child DDOs with a relates-to constraint are notified of the new record. It will clear or find as required. |