Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建两种类型的自定义对象。每个都有一个引用另一种类型对象的属性。本质上,我想创建具有双向关系的双链接对象对。这是一个有效的用例,还是会破坏任何东西?
一个例子:
乐队:披头士;成员:{约翰、保罗乔治、林戈}
音乐家:林戈;乐队:披头士乐队
是的,这很好。
对象 1:乐队对象 2:音乐家
Band 引用一个 Musician 对象数组 Muscial 引用一个 Band 对象,或者一个 band 对象数组。
您需要将引用设置为在对象的设置中期望引用对象的数组。