DDD:从哪里获取值对象列表最合适

发布于 2024-07-20 08:09:27 字数 169 浏览 4 评论 0原文

我有一个分配给产品的名为“产品类型”的值类型。 (产品有一种产品类型)

为了允许用户从列表中选择类型,我将填写一个下拉列表。 在哪里检索产品类型列表最合适? 实现存储库模式的类?

编辑:通过将产品代码更改为产品类型来澄清。 产品类型类似于“DVD”/“CD”/“蓝光”等。

I've got a value type called "Product Type" that is assigned to a product. (A product has one product type)

To allow the user to select the type from a list, I'm going to fill a dropdown. Where is it most appropriate to retrieve the list of product types? A class implementing a repository pattern?

Edit: Clarified by changing product code to product type. A product type is something like "DVD"/"CD"/"Blu Ray"/etc.

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

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

发布评论

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

评论(1

空城之時有危險 2024-07-27 08:09:27

产品似乎是聚合根,因此产品类型列表应该位于 ProductRepository 中。

Product seems to be aggregate root, so list of product types should be in ProductRepository.

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