开发者

How Does One Implements Lists in Domain Driven Design?

How does one implement lists such as开发者_如何学Go a list of months in the year, or a list of years in DDD? Where does the logic go, inside value objects, a service, is it part of the domain layer?


IMHO Lists can be Entities, Value Objects and Aggregates as well. It depends on what kind of Lists they are. List of months in year could be Value Objects, when used often in different contexts, maybe the logic should be in services. List of items in the cart (when you don't expect it can grow too big) might be an Entity. List of users in the system with relationships could be implemented as an Aggregate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜