stackoverflow 标签问题 Vo 或实体或单独的根聚合
在领域驱动设计的上下文中,stackoverflow 中的标记是值类型,请参阅下面的链接讨论。
但是如果是值类型那么将来如果有人想要创建新标签,他将如何执行?
在我的项目中还有一个与广告实体关联的标签,一对多,但是如果我将标签视为值类型,并且将来如果我想在数据库中添加新标签。我该怎么做,因为标签是 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在可能的标签列表的上下文中,标签是一个实体。
应用于问题的标签是一种值类型。事实上,从顺序的角度来看,它甚至不是一个类 - 它实际上只是一个字符串。
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.
标签是一个实体。它具有概念标识,请参阅我的答案。您创建它就像创建任何其他实体一样。
Tag is an entity. It has conceptual identity, please see my answer. You create it just like you create any other entities.