I think it ends up depending on what you're doing. For the last couple of apps that I've done, I've used custom dto patterns for all of our client apps. However, our products have a system management utility which essentially does CRUD operations on entities. The custom dtos kept ending up looking exactly like our domain objects. The stress in trying to share code and behavior between client applications was becoming a pain.
At any rate, for me passing domain dtos to this particular client isn't more data or trouble than the custom ones. When a particular use case requires a vastly different view of the data, I certainly intend to create custom objects for it, and I'll assemble them elegantly. For my other applications, custom dtos make a lot of sense. I'm just not buying into an entire layer of indirection that I'll mostly not use. (See Refactoring: Speculative Generality, Shotgun Surgery for more detailed reasons)
Phill
|