tl;dr
You have modeled the Address entity as Customer’s daughter entity, but it is only a related entity.
Understanding what an address is
Normally, when I’m designing a concept, I feel the need to be skeptical about it, that is, to doubt what I know of it. So I usually end up discovering something new that changes the design.
That said, the best thing to do is to understand how Post office identify an address. What I reproduce below for historical purposes:
- Name of the recipient
- Name of the patio (a street or avenue), residence number, complement (usually an apartment number)
- Name of the district (optional)
- City name and state name
- ZIP CODE.
- Latitude and Longitude
Item 1 we usually assign to another entity, such as, in your case, Customer, Company and Supplier. Item 6 is immutable because a different latitude and longitude represent a different address/location.
For items ranging from 2 to 5, all can be changed. Examples:
- The name of a street (which was misspelled in the system or which was changed by the town hall)
- A neighborhood that was created
- A district that has become a new city
- The format of the CEP, which was amended in 1992.
In either of the above two examples we, developers and users, want that once an attribute has been changed, the new value is applied to everyone using that attribute. That is, if a street has changed its name, the desirable is that the new name be applied to all customers and suppliers who reside there.
This shows us that an address has a life cycle and that if one of its attributes changes, it can still be the same address. Therefore, address is an entity, not an object of value.
Daughter entities and related entities
Daughter entities are those whose life cycle is directly linked to that of the parent entity, such as a project and a task (task). A terefa exists only within a project and when a project is deleted, the task is also.
Related entities are those that are linked to other entities but have an independent life cycle, such as addresses.
Reference
Finally, an aggregate may contain parent entity, daughter entities and value objects. An aggregate shall not contain related entities.
What language are you using? How is your code?
– Vinicius Fernandes