开发者

Avoiding getters and using DTOs for the retrieval of information when using DDD

开发者 https://www.devze.com 2023-01-12 07:31 出处:网络
Greg Young talks about avoiding getters and setters on domain objects when using Domain Driven Design. For the use case where I want information from a persistent store to be rendered to the screen, w

Greg Young talks about avoiding getters and setters on domain objects when using Domain Driven Design. For the use case where I want information from a persistent store to be rendered to the screen, what would the object model look like when following this architectural pattern?

Would I expect to see a DTO being retrieved directly from a repository, or perhaps an independent DtoService, supplying the Dto instances directly to the "UI l开发者_JAVA技巧ayer" (say a controller)?


Have a look at CQRS; notion would be that you would return a view specific DTO either from a reporting service or reporting view specific datastore

0

精彩评论

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

关注公众号