开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜