New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling for commands #12

dangoor opened this Issue Oct 4, 2018 · 0 comments


None yet
1 participant
Copy link

dangoor commented Oct 4, 2018

The ports and adapters example is really, really great. This series is the most readable assembly of this set of concepts that I have seen so far, and I think this style of architecture is one that people could benefit from using a lot more.

Something I took note of as I was reading through was that you never really touched on error handling. If CQS dictates that no values are returned when you're writing data, what do you do if some invariant is violated and thus you can't write the data?

Do you raise an exception? (which is a kind of return value, albeit one intended for unexpected cases)

Do you instead have validation at another layer, doing a Query to inspect what the command is trying to do before running the Command?

Here's an example: what if the assignee for an issue had to be one of a known list? Where would you check that?

I have thoughts on approaches to this, but I'm curious to know how you handle the situation in the architecture you've built up.

Thanks for putting the effort into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment