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
精彩评论