Command Query Separation validating for retries
Posted
by Neil Barnwell
on Stack Overflow
See other posts from Stack Overflow
or by Neil Barnwell
Published on 2010-05-05T11:27:07Z
Indexed on
2010/05/06
8:48 UTC
Read the original article
Hit count: 216
So I'm comfortable with the basic concept of CQS, where you might have a command that writes to one database, and that updates the query database that you read from.
However, consider the scenario where you are entering data, and want to prevent duplicates.
Using new employee data entry an employee register as an example, working through a pile of application forms to key in the new employees' details:
- Take top sheet.
- Key in employee name and unique payroll number to UI.
- Submit.
- Put paper in "completed pile".
- Repeat.
How would you now prevent the user from keying in the same payroll number again, say for instance if they get distracted and can't remember whether they've keyed one in already and the "message" hasn't got all the way back to the query db for the user to search?
© Stack Overflow or respective owner