[英]How can I represent addition of classes in UML class diagram?
I am required to use a UML class diagram to represent a model implementation done in Python.我需要使用 UML 类图来表示在 Python 中完成的模型实现。 I have a case where
Kernel_A
+ Kernel_B
→ Kernel_AB
using __add__()
method in the class.我有一个案例,
Kernel_A
+ Kernel_B
→ Kernel_AB
在类中使用__add__()
方法。
These are class variables of a model, called Model_A
, which is itself also a class variable of a class which performs estimation, lets call this Algorithm_A
.这些是模型的类变量,称为
Model_A
,它本身也是执行估计的类的类变量,我们称之为Algorithm_A
。 Algorithm_A
also has a class variable which is a separate model, Model_B
, which is not related to the kernels. Algorithm_A
也有一个类变量,它是一个单独的模型Model_B
,它与内核无关。
Primarily, I am not clear on how to represent the relation between the kernel classes in the UML class diagram.首先,我不清楚如何在 UML 类图中表示内核类之间的关系。 Meaning that the
kernel_AB
is an addition of the classes kernel_A
and kernel_B
.这意味着
kernel_AB
是类kernel_A
和kernel_B
。 Both of kernel_A
and kernel_B
have the same methods, but different class variables given that they are dictated by different parameters. kernel_A
和kernel_B
具有相同的方法,但由于它们由不同的参数指定,因此具有不同的类变量。
I am also not entirely clear on how to represent the class variable relationship between Model_A
and Algorithm_A
.我也不完全清楚如何表示
Model_A
和Algorithm_A
之间的类变量关系。 Is this an aggregation relationship, shown with a diamond arrow?这是一个聚合关系,用菱形箭头表示吗?
To reiterate the components and relations:重申组件和关系:
Kernel_A
+ Kernel_B
→ Kernel_AB
( __add__
method to create Kernel_AB
) Kernel_A
+ Kernel_B
→ Kernel_AB
(创建Kernel_AB
__add__
方法)
Kernel_AB
→ Model_A
( Kernel_AB
class variable of Model_A
) Kernel_AB
→ Model_A
( Kernel_AB
的类变量Model_A
)
Model_A
→ Algorithm_A
( Model_A
class variable of Algorithm_A
) Model_A
→ Algorithm_A
( Model_A
的类变量Algorithm_A
)
Model_B
→ Algorithm_A
( Model_B
class variable of Algorithm_A
Model_B
→ Algorithm_A
( Model_B
的类变量Algorithm_A
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.