I'm writing an application with a domain model in PHP, and am wondering which naming convention I should adopt.
Let's say I have a Customer, having an Address within its aggregate root.
I also have a Product, having an Option within its aggregate root.
I have two alternatives:
Keep aggregate roots at the root of the domain model:
Customer Customer\Address Product Product\OptionPro: I can use both
CustomerandProductin the same namespace
Con:Customerhas to reference its ownAddressasCustomer\AddressGroup all aggregate classes in the same namespace, including the aggregate root:
Customer\Customer Customer\Address Product\Product Product\OptionPro:
Customercan reference its address asAddress
Con: from my root domain namespace, I have to reference:CustomerasCustomer\CustomerProductasProduct\Product