问题
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