I am working on DataMgr 2.1 and I have run into an issue with which I would love some advice. This doesn't require any knowledge of DataMgr itself.
This problem deals with many-to-many joins. For example a user could be a member of multiple groups and each group could have multiple users as members. This would generally be handled by a join table. For example, if users were stored in a "users" table and groups were stored in a groups table, the relationships between them might be stored in a "users2groups" table.
A relationship could also be self-referential. For example, products (represented with a "products" table) could reference related products (also in the products) table. This could also be handled with a join table.
The question I have is how to handle the bidirectional quality of these relationships.
In the case of users and groups, if a user is a member of the group then the group has the user as a member (yes, I realize that was tautologous). This is because a row exists in "users2groups" to represent the relationship between the two. More specifically, this row represents a bidirectional relationship between the two tables.
In the case of a self-referential table, however, this is not necessarily the case. Each row of the join table only represents a unidirectional relationship between the product and the related product.
So, if "products2relatedproducts" had the fields "product_id" and "relatedproduct_id" (each referencing the "product_id" field of the "products" table) then the row would indicate that one-way relationship. If product "A" had product "B" as a related product in this table, then the row would not show that "B" had "A" as a related product.
This scenario is inconsistent with how many-to-many relationships generally work.
So, finally for the question:
If such a relationship is managed through DataMgr, would it make sense (and be helpful) if DataMgr enforces the bidirectional nature of the relationship (making self-referential relationships more consistent with other relationships)? Would it be better to have this as an option?
Thanks in advance for any and all thoughts.