We have many different aggregates that use an address entity. But we also have an address aggregate because we have a global address book as well.
- Aggregate Company has many Address Entities
- Aggregate Agency has many Address Entities
- Aggregate Address
From a DDD perspective each aggregate is of course independent. But our fancy requirement here is, that when a company is using the same address as the agency we need to update the state of the agencies address entity and the state of the address aggregate as well - because they can be the same.
Let me try to phrase it this way: An address should be unique in the system but we also need to be able to record changes to the addresses in our event history.
What is the proper way of updating the state for each aggregate that shares the same address that gets changed?