samedi 23 février 2019

DDD - how to model aggregate root?

I have a domain called product_catalog. In my domain a Brand can owns many products. (1 to Many relationship) A category could have many products, and a product could belong to many categories. It's a N-to-M relationship.

If I design product as the aggregate root, it will make no sense to retrieve product to create a brand. Besides that, I need to retrieve all brands and make it possible for the user create more brands So I suspect that Brand is an aggregate root too. Is that right?

What about categories and product?

Aucun commentaire:

Enregistrer un commentaire