I am attempting to build an application in a DDD way. Imagine the Aggregate root is a 'Page' which has other aggregates such as Author, Commenter, Comments, Status etc...
A page can also have various settings such as:
- Private page
- Allow comments
- Allow anonymous comments
- Lock after x Date
- Slug
I am trying to consider the best way to model these 'settings'. Currently I am looking to have a Settings collection that has each individual setting as a value object. As you can see some of these are essentially boolean values and others might contain specific values such as a date. Given there might be dozens of settings, some with defaults, do I model the 'settings' collection with each specific setting, or just as a collection with the applicable settings?
Is there a 'better' or standard DDD way to approach this problem? I was considering using the specification pattern here but have concluded it doesn't really apply
Sorry a cheeky second question....
A page can have one of many statuses (e.g. draft, published, scheduled, archived) but only one status at a given time. Similar question in terms of the best way to model this. As a status represents something that has an identity I have implemented the status as an entity for the moment. I was wondering would a better approach be to model this as a workflow or a status history even?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…