Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

缺乏描述资源与资源之间绑定关系的有效表达方式 #425

Open
chuan6 opened this issue Mar 5, 2018 · 0 comments
Open

缺乏描述资源与资源之间绑定关系的有效表达方式 #425

chuan6 opened this issue Mar 5, 2018 · 0 comments
Assignees
Labels

Comments

@chuan6
Copy link
Contributor

chuan6 commented Mar 5, 2018

起因:当接收到 websocket 消息 { e: ':remove:teams/__projectId__', d: '__teamId__' },目前会直接删除 Team 表中主键为 __teamId__ 的行。但其实这是不准确的。这条消息更通用的语义是解除 id 为 __teamId__ 的部门与 id 为 __projectId__ 的项目之间的关系;如果有应用订阅了这条关系,那么在收到这样的 websocket 消息后,这条关系就在推送的结果集中消失。

为什么之前该问题并未显现:只有当一种资源同时与多种其他资源绑定,并且取消其中的一个绑定并不必然导致所有其他绑定都取消,才会需要显式地将这些绑定管理起来。如 team,它与 organization 有绑定,同时也能与 project 有绑定,而且当其与 project 解绑时,不会与 organization 解绑。而不似如 event 这样的资源,只与项目绑定。

也许可以参照或直接利用已有的 ObjectLinkSchema。

@chuan6 chuan6 added the FEATURE label Mar 5, 2018
@chuan6 chuan6 self-assigned this Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant