DDD: Where is it most appropriate to get a list of value objects

淺唱寂寞╮ 提交于 2019-12-06 04:47:12

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/901462/ddd-where-is-it-most-appropriate-to-get-a-list-of-value-objects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!