Search code examples
umldomain-driven-design

Need Clarification On eCommerce Domain Model For Identity


enter image description here

Are my domain models valid.

Have i mapped the relationships in correct order?

In my use case wondering how to register a seller, buyer and employee.

Because i am confused which one to be chosen as aggregate root - a concrete user(seller, buyer, employee) or account entity?


Solution

  • Hard to answer without knowing the details of your business domain. However, lets go with whatever available.

    how to register a seller, buyer and employee.

    This statement probably implies that these three (seller, buyer, and employee) are prominent ideas in your domain, therefore constitute your ubiquitous language. Account, on the other hand, seems to be a technical detail supporting the domain. Though details are not sufficient, those three sounds to be more aligned to your domain's ubiquitous language than account (compare, for example, a buyer places an order with an account places an order or a seller introduces a new product with an account introduces an new product). These are primary indicators of aggregate roots.

    Once you are convinced that those three are your aggregate roots, construct account as part of their construction just as you'd do for any of their constituents.