英文:
Is my class diagram for multi user role based app right?
问题
在我的情况下,每个用户可以被赋予一个或多个角色,某些角色需要额外的属性(例如,“代理维护”角色具有“特殊ité”字段)。 "Administrateur" 角色可以添加/更改其他用户的角色。如果我的模型工作正常,是否有更好的表示方法?
英文:
In my case,
each user can be attributed one or multiple roles, some roles require extra attributes (for exp "agent maintenance" role hase "spécialité" field).
The "Administrateur" role can add/change roles of other users.
if my model works fine, is there any better representation?
答案1
得分: 0
- multiplicity
1..*
tells that a user can have one or more roles - each of the role can be an instance of one of the specialisation of the abstract role; each specialisation may therefore have different attributes.
然而,并没有说明 Administrator
可以更改其他人的角色。有许多表示方法,例如在 Administrator
中预见一些专用于管理其他角色的操作。
英文:
Your model is fine:
- multiplicity
1..*
tells that a user can have one or more roles - each of the role can be an instance of one of the specialisation of the abstract role; each specialisation may therefore have different attributes.
However, nothing says that Administrator
can change roles of others. There are plenty of ways to represent this, for example foresee in Administrator some operations dedicated to the management of the other proles.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论