I have a concept that I am struggling to design in a DDD CQRS manner, and I hope to find some insight.
In the old days (before I knew DDD) I would have used simple inheritance, and that's how my mind is wrapping around the following...
SingleValuePropertywhich has a
AttributedPropertywhich has a collection of
The latter two are basically the same base concept as they share 8 class attributes, and would use the same
Events to be managed in the domain. I am stuck at how to furnish them in the DDD Aggregate Root concept as it feels weird to have the
Repository return different types of object.
On the other hand, I also feel that it's ok and still follows the SOLID principles, as this is what inheritance is for right?
Anyone got any hints on how to model this dilemma?
I want to add more context as it may sway the consideration.
Property is created with only it's main 8 attributes. After that the other aspects like addition of
Attributes or choice of
PropertyType are added to the
Property. Does this mean 3 separate aggregate roots?