As part of my domain model, lets say I have a WorkItem
object. The WorkItem
object has several relationships to lookup values such as:
WorkItemType
:
- UserStory
- Bug
- Enhancement
Priority
:
And there could possibly be more, such as Status
, Severity
, etc...
DDD states that if something exists within an aggregate root that you shouldn't attempt to access it outside of the aggregate root. So if I want to be able to add new WorkItemTypes like Task, or new Priorities like Critical, do those lookup values need to be aggregate roots with their own repositories? This seems a little overkill especially if they are only a key value pair. How should I allow a user to modify these values and still comply with the aggregate root encapsulation rule?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…