PHP でドメイン モデルを使用してアプリケーションを作成していますが、どの命名規則を採用すべきか迷っています。
Customer
があり、Address
その集約ルート内
に があるとしましょう。
また、集約ルート内Product
に を持っています。Option
私には2つの選択肢があります:
集約ルートをドメイン モデルのルートに保持します。
Customer Customer\Address Product Product\Option
長所:同じ名前空間で 両方を使用でき
Customer
ます短所:独自のものを次のように参照する必要がありますProduct
Customer
Address
Customer\Address
集約ルートを含め、すべての集約クラスを同じ名前空間にグループ化します。
Customer\Customer Customer\Address Product\Product Product\Option
Pro :
Customer
そのアドレスをAddress
Conとして参照できます。ルート ドメインの名前空間から参照する必要があります。Customer
なのでCustomer\Customer
Product
なのでProduct\Product