我可以在 UML 的域模型中显示泛化关系吗

发布于 2024-07-06 19:03:38 字数 131 浏览 2 评论 0原文

我想问是否可以在 UML 中显示域模型的泛化关系,尽管我知道我可以在类图中做到这一点? 除了类图中,我没有看到太多显示泛化关系的领域模型的例子。 如果不可能,显示域模型中的实体是实体 A 或实体 B 或实体 C 或实体 D 等的最佳方式是什么?

I would like to ask if it is possible to show Generalization relationship in UML for a Domain Model although I understand I can do that in a Class Diagram? I did not see much examples of Domain Model displaying Generalization Relationship except in Class Diagram. If not possible, what is the best way to display that an Entity in a Domain Model is either a Entity A or Entity B or Entity C or Entity D etc ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

骷髅 2024-07-13 19:03:38

是的,域模型中的实体之间的泛化是允许的。

基本上,域模型是一个类图,其中类显示概念设计中的实体类型,而不是典型类图中显示的具体编程语言类。

为了更好地找到你能做什么或不能做什么,你可以阅读 UML 2 .x上层建筑规范,但理解起来相当复杂。

我通常倾向于自由地使用任何传达我的设计的东西,但是如果您受限于某些有点严格的特定建模工具,那么您应该熟悉 UML 规范。

Yes, generalization between entities in your domain model is allowed.

Basically, the domain model is a class diagram, where classes show the types of entities in your conceptual design, and not concrete programming language classes that you show in your typical class diagram.

To better find what you can or can't do, you can read the UML 2.x Superstructure specification, but it is quite complex to understand.

I generally tend to freely use whatever communicates my design, but if you are constrained to some specific modeling tool that is somewhat strict, you should become familiar with the UML specification.

零崎曲识 2024-07-13 19:03:38

您需要澄清为什么要区分域模型和类图。

一方面,您的域模型可以只是可以映射到数据库并使用它的所有内容的类图。 因此,泛化关系可以简单地描述实现继承或接口继承。

另一方面,您的领域模型可以简单地表达您期望类如何工作。 在这种情况下,它可以是任何标准 UML 图:类、序列、协作、组件、活动等。

ADD:您是否正在讨论寻找不同的方法来对持久实体进行分类,例如标记系统? 或者您可以使持久实体在类别树中拥有许多节点成为可能?

You need to clarify why you're distinguishing between a domain model and a class diagram.

On the one hand, your domain model could simply be a class diagram of everything that could map to your database, and consume it. Hence a generalization relationship could simply depict implementation inheritance or interface inheritance.

On the other hand, your domain model could simply express how you expect your classes to work. In which case, it could be any of the standard UML diagrams: class, sequence, collaboration, component, activity, etc.

ADD: are you talking about finding different ways to categorize your persistent entities like a tagging system? Or you could make it possible to have a persistent entity have many nodes in a category tree?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文