@yreynhout
unread,Apr 19, 2014, 6:52:20 PM4/19/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ddd...@googlegroups.com
DTOs tend to do what their name implies, nothing more, nothing less. So, yeah, I can follow your reasoning. Many seem to not understand that DDD is (among others) an evolutionary, model centric approach to software development and that aggregates, entities, value objects, repositories, factories, domain events & services (in an OO language at least) are tactical <<patterns>> model concepts get classified into (and so us devs have some definitions to bicker about ;-)). What I'm getting at is that you tend to evolve the model first (you know, a set of abstractions that solves a problem in the domain) and somewhat separate, if only in your head (or as a team effort, duh). DTOs are at best the thing that lands in your application service (you can build those without DTOs as well). Because at the end of the day, that behavior inside the model needs invoking (and there are lots of ways you can do that). But since it takes a lot of effort to crank out a decent UI (with bickering about which client fx and libs to use), remote facade (with bickering about rest/soa/micro/vnext), and some data storage (with bickering about acidity and other aspects of the underlying store) as a whole, the careful crafting of a model - somewhat in isolation, with a lot of polishing, communication, focus on language, collaboration along the way - gets pushed back into a dark, dusty corner (if any effort is spent on that at all). Hence why these "shortcuts" seem to pop up, because too much mapping is a violation of "DRY", no?! So, let's just shove our messaging constructs right into the model and create some nice coupling. No, thank you.
But never say never, since there might be other languages, paradigms, ... that do away with all this bad-taste-in-mouth.