Search code examples
domain-driven-designaggregaterootddd-service

Which project in a solution to add a Domain Service that spans two aggregates?


I currently have two projects within one Visual Studio solution. Each project represents a different aggregate. I need to add a domain service that interacts with the two aggregate roots. Which project should I add it to? Does it matter?


Solution

  • Imagine you're building an ecommerce app. In your case when you create a product, the data should be decomposed by ui micro controllers which belong to their bounded contexts (shipping, invoicing) (like hyenas) and send info they interested in to bounded context data storage for future fulfilling their capabilities. As a shipping isolated module, in order to calculate shipping cost, I need product weight, hence I should tear away that info when user inputs that data on UI.

    https://www.youtube.com/watch?v=hev65ozmYPI - Check out this link.