uml问题——泛化
我有一个疑问。想象一下我有三个类别:学生、工人、学生/工人。
正确的是:
ProfissonalArea
| | |
| | |
student worker/student worker
或者存在更好的方法吗?问题是学生可以有作业。
谢谢
i have a doubt. Imagine that i have three categories: student, worker, student/worker.
the correct is :
ProfissonalArea
| | |
| | |
student worker/student worker
or exists a better way to do that? the problem is that a student can have a work.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么一个人必须只与一个类别相关联?这只会迫使您枚举所有可能的组合。您可能会更好地使用可以同时指定多个类别的多值字段。
如果这是不可能的,至少使用继承,这样,例如工作学生的情况将是工人和学生的实现,而不是完全不同的事情。
Why does a person have to be associated with one category only? That will only force you to enumerate all possible combinations. You would probably be better off with a multi-value field where multiple categories can be specified simultaneously.
If that is not possible, at least use inheritance, so that e.g. the case of a working student will be an implementation of both a worker and a student, rather than a different thing altogether.