解析关系:哪个 Class 应该拥有它?

Parse Relations: which Class should own it?

使用 Parse.com "Relations",您如何确定 2 类 中的哪一个应该拥有关系?

例如,想想 WhatsApp 群组。

用户是否应该有一个列出其订阅的所有组的关系?

或者 Group 是否应该有一个列出组中所有用户的关系?

而且,在每一个中建立关系有意义吗?复制数据?

取决于您是否要在 类 之一中存储一些元数据。在文档的这一部分中解释得很好:

https://parse.com/docs/relations_guide#manytomany-relations

The decision point here is whether you want to attach any metadata to the relationship between two entities. If you don’t, Parse Relation or using Arrays are going to be the easiest alternatives. In general, using arrays will lead to higher performance and require fewer queries. If either side of the many-to-many relationship could lead to an array with more than 100 or so objects, then, for the same reason Pointers were better for one-to-many relationships, Parse Relation or Join Tables will be better alternatives.

在你给的whatsapp中,既然你有访问用户的权限,我认为它应该更像是用户所属的组。阅读多对多关系,假设组为书,用户为作者。有道理