stackoverflow 标签问题 Vo 或实体或单独的根聚合

发布于 2024-10-15 22:02:36 字数 363 浏览 4 评论 0原文

在领域驱动设计的上下文中,stackoverflow 中的标记是值类型,请参阅下面的链接讨论。

DDD:SO 标签。实体还是值类型?

但是如果是值类型那么将来如果有人想要创建新标签,他将如何执行?

在我的项目中还有一个与广告实体关联的标签,一对多,但是如果我将标签视为值类型,并且将来如果我想在数据库中添加新标签。我该怎么做,因为标签是 VO。创建广告时,我只能将现有标签分配给新广告,但是我将如何创建新标签

In the context of domain driven design, tag in stackoverflow is value type, see below link discussion.

DDD: SO tag. An Entity or value type?

But if it is value type then in future if any one wants to create new tag, how will he perform that ?

in my project is also there is tag which is associated with an advertisement entity, 1 to many, but if i consider tag as a value type and in future if i want to add new tag in data base . How would i do that, because tag is VO. while creating advertisement i can only assign existing tag to a new advertisement , but how will i create new tag?

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

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

发布评论

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

评论(2

尴尬癌患者 2024-10-22 22:02:36

在可能的标签列表的上下文中,标签是一个实体。

应用于问题的标签是一种值类型。事实上,从顺序的角度来看,它甚至不是一个类 - 它实际上只是一个字符串。

In the context of the list of possible tags, tag is an entity.

A tag as applied to a question is a value type. In fact, it's not even a class from the order's perspective - it's really just a string.

旧伤还要旧人安 2024-10-22 22:02:36

标签是一个实体。它具有概念标识,请参阅我的答案。您创建它就像创建任何其他实体一样。

Tag is an entity. It has conceptual identity, please see my answer. You create it just like you create any other entities.

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