UML:使用继承不会在数据库中造成问题
UML : The use inheritance does not pose a problem in the database
对这种情况建模的好方法是什么,在我的 class 图表中,我有一个 class 问题,该问题将有一个类型(QCM - 编码)并且在每种类型中我都有不同的类型属性。
如果我在 class 问题和类型之间进行继承,它将在数据库中工作
I have a class question that will have a type either (QCM - coding) and in each type I have defferents properties.
由于关系中的多重性 1,type_question
实例必须与 libre 和 codage[ 的实例相关联=42=](可能还有 qcm)。
要表示 type_question
是其中之一,最好是:
其中 type_question
是一个摘要 class。
属性 contenu 可能取决于问题的类型,也许使用 'standard' 属性不是最好的方法。我不建议将它移动到 type_question
的子 classes 中,因为多重性 0..n 表示 type_question
的给定实例可以关联到 [=15] 的多个实例=].
if I made the inheritance between the class question and the type is that it will work in the database
即使不考虑数据库 question
继承 type_question
与 type_question
的给定实例可以关联到 question
的多个实例这一事实也不相容,并且也不符合我上面的建议。
假设你无论如何都有继承,如果我没记错的话,当你考虑数据库时(你没有说如果 SQL 等)继承消失并作为关系管理,如当前或包括继承继承 class 中的行为。
对这种情况建模的好方法是什么,在我的 class 图表中,我有一个 class 问题,该问题将有一个类型(QCM - 编码)并且在每种类型中我都有不同的类型属性。
如果我在 class 问题和类型之间进行继承,它将在数据库中工作
I have a class question that will have a type either (QCM - coding) and in each type I have defferents properties.
由于关系中的多重性 1,type_question
实例必须与 libre 和 codage[ 的实例相关联=42=](可能还有 qcm)。
要表示 type_question
是其中之一,最好是:
其中 type_question
是一个摘要 class。
属性 contenu 可能取决于问题的类型,也许使用 'standard' 属性不是最好的方法。我不建议将它移动到 type_question
的子 classes 中,因为多重性 0..n 表示 type_question
的给定实例可以关联到 [=15] 的多个实例=].
if I made the inheritance between the class question and the type is that it will work in the database
即使不考虑数据库 question
继承 type_question
与 type_question
的给定实例可以关联到 question
的多个实例这一事实也不相容,并且也不符合我上面的建议。
假设你无论如何都有继承,如果我没记错的话,当你考虑数据库时(你没有说如果 SQL 等)继承消失并作为关系管理,如当前或包括继承继承 class 中的行为。