我的多用户角色基础应用的类图是否正确?

huangapple go评论94阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年6月30日 04:53:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76584554.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定