george_mauer | 2 Jul 03:28
Picon
Gravatar

Does CQS Break Down the Ubiqutous Language?

I was listening to Greg Young on Herding Code and much of what he was saying made perfect sense and stroked my
developer instinct in exactly the right way.  Of course applications shouldn't be just CRUD and of course
it is the behaviors that matter!

One question that I have comes up when Greg talked about avoiding getters and setters in your domain
entities.  I have heard this refrain before and now I feel like I am starting to grasp the reasoning behind
it.  One related thing that he mentioned - and Greg, I know you read this so correct me if I'm wrong - is that it
usually makes more sense to project your display data directly to DTOs rather than having a domain
middle-layer get involved.  

Again, this makes sense but I wonder if it doesn't start to break down the ubiquitous language somewhat?  For
example, when your domain experts discuss a Customer they don't only talk about adding a valid address
which validates against their listed zip code, they talk about being able to check the customer's address
as well!  If you don't have an address getter on the customer, then it seems like when your domain expert says
something like "at this point the customer address should be xyz" you will no longer have a 1-to-1
correspondence between the language and your domain.

Can someone clarify how this is supposed to work? 

------------------------------------


Gmane