这个基于领域模型的 uml class 图的关系是否正确,需要的方法应该放在哪个 class 中?

Are the relations of this domain model based uml class diagram correct and in which class should required methods be placed?

我目前正在尝试可视化订购软件的 class 图,其中 Employee/User 能够创建新订单,其中包含有关 Customer 的信息, Products、当前状态和从事该特定 Order.

工作的 Employee

我的问题是我不知道应该在哪个 class 中调用哪些方法。方法 createOrder() 应该在 class Order 中创建自己还是在 class User 中,因为 User 创建 [=16] =]在软件中。

我尝试放在 classes 中的方法是:

非常感谢对我的 uml class 图的批评和建议。

我当前的图片 domain model class- diagram。

ER- diagram and a simplified state- diagram 的图片,以便更好地了解我的项目(都在一张图片中,因为我只能 post 两个链接。

我再给你一个建议 class - 篮子。每个用户都有一个篮子,可能是空的。篮子的一个实例有一个产品 - 数字对的映射。那么很明显,什么应该调用 createOrder() - 篮子应该。此刻,下完单,篮子丢了,又免费了。

至于 GetAll... 函数 - 使它们成为静态的,或者换句话说,属于 class,而不是实例。这很简单 - 每个 class 都可以计算或列出其实例或特定实例。