且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 UML 中使用子集属性?

更新时间:2023-11-24 22:32:46

根据 UML 2.4.1 规范,Subsetted Property 引用了该属性被约束为其子集的属性.真实世界的例子是什么意思?我想 UML 规范就是其中之一......但是您可能会在所有应用程序中发现这种属性,其中一个对象与另一个相关联,并且在它们的两个子类型的上下文中重新定义了这种关联.例如,Animal 类可以关联到 Limb 类.我们还可以定义两个类HumanLeg,分别扩展AnimalLimb.最后,我们可以将 HumanLeg 关联起来,这将重新定义先前存在的关联.

According to UML 2.4.1 specification, Subsetted Property references the properties of which this property is constrained to be a subset. What do you mean by a real-world example ? UML specification is one of them I guess... But you might find this kind of properties in all applicatioh where an Object is associatded to another and this association is redefined in the context of two of theirs subtypes. For example, an Animal class can be associated to a Limb class. We can also define two classes Human and Leg extending respectively Animal and Limb. Finally we can associate Human and Leg which will be a redefinition of the preexisting association.

希望有帮助,BR