领域模型和类图 [英] Domain model and class diagram

查看:31
本文介绍了领域模型和类图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我的概念模型和类图之间是否可能存在差异?

I was wondering if it was possible to have differences between my conceptual model and the class diagram?

在概念模型中,我解释了用户可以创建消息.

In the conceptual model, I explain that the user can create a message.

但是在类图中,用户必须经过一个包含创建ManageMes​​sage"消息的所有方法的类.

But in the class diagram the user must go through a class that contains all methods of creating a "ManageMessage" message.

这是一个例子

你能帮我吗?谢谢

推荐答案

如何在不同的图表中显示您的类取决于您.因此,在一个中您可以显示详细的属性和操作,而在另一个中您只显示类名.然而,在大多数情况下,最好在一开始就创建专注于业务方面的领域模型.它没有技术上强加的结构元素,主要使用属性 (YMMV).之后,您从该模型派生出技术设计,在其中创建一个副本,该副本链接回 <> 依赖项(UML 工具为此提供转换).尽管您必须(大部分)手动同步这两个模型,但最好与业务和开发人员沟通.

It's up to you how you show your classes in different diagrams. So in one you can show detailed attributes and operations and in another you show just the class name. However, in most cases it's better to create domain model which focuses on business aspects in the beginning. It does not have technically imposed structural elements and mainly you use attributes (YMMV). Later you derive a technical design from that model where you create a copy that links back with <<trace>> dependencies (UML tools offer transformation for that). Although you have to (mostly) manually synch the two models it's best to communicate with either business and developers.

注意关于你上面的设计:零相关用户的消息似乎没有多大意义.您也不应该使用共享聚合,因为它没有定义的语义.

N.B. about your design above: A message with zero related users does not seem to make much sense. Also you should not use the shared aggregation since it has no defined semantics.

这篇关于领域模型和类图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆