Any of these sound familiar?
Rubbish in rubbish out.
Never trust user input.
If you’ve ever built any sort of professional application you will have had to validate user input. Whether it is to ensure a valid email address or something more complicated. There are tried and tested ‘rules’ for doing this safely while being nice the user.
But here’s a question..
If you issue commands rather than send in models, where should the validation occur?
The most obvious answer is in the domain model.
But this poses a problem…Continue reading