英文:
Use case Actor generalization
问题
你的用例图是否正确?
我需要知道我的用例图是否正确,如果管理员从经理继承,经理从技术员继承,这是否意味着管理员和技术员之间的泛化是不必要的,可以通过经理和技术员之间的关系来实现?
英文:
Is my use case diagram correct ?
I need help to know if my use case diagram is correct or not, and if the actor admin inherits from manager, and manager inherits from technician, does that mean the generalization between admin and technician is unnecessary and can be done through the relation between manager and technician?
答案1
得分: 0
你图表中的泛化意味着:
- Manager -|> Technician:每个 Manager 的实例也是 Technician 的实例。
- Admin -|> Manager:每个 Admin 的实例也是 Manager 的实例。
这意味着每个 Admin 的实例也是 Technician 的实例,即 Technician 也是 Admin 的泛化。
因此,Admin 和 Technician 之间的直接继承关系是多余的。这不是错误,但考虑到多重继承让一些人感到不舒服,我建议避免它。
英文:
The generalizations in your diagram means that:
- Manager -|> Technician : every instance of Manager is also an instance of Technician.
- Admin -|> Manager : every instance of Admin is also an instance of Manager.
This implies that every instance of Admin is also an instance of Technician, i.e that Technician is also a generalization of Admin.
Your direct inheritance between Admin and Technician is therefore redundant. It is not wrong, but considering that multiple inheritance make some people unconfortable, I'd suggest to avoid it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论