Search code examples
domain-driven-designentitiesbounded-contexts

DDD: bounded contexts - domain entities that reference concerns in another bounded context


I'm getting confused on how to define bounded contexts where there are shared concerns between them, and how to represent this with Domain Entities.

For example: A customer has many products in a Customer context A company has and a list of products in the Company context

So the customer is managed via the customer context, and the company via the company context

Given the contexts are in differnt modules.

If I want to provide the Company's address details with a product, how should this be handled?

Do I reference the module containing the Company context in the module containing the customer, or do I create a Company entity in the customer context specifically for use when interacting with customers?

Thank you


Solution

  • You can have different representations of the same entity in different bounded contexts. Company in Company BC can be very different from company in User BC. All they have to share is some kind of correlation Id.