Skip to content
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

Aftermath and CQRS #4

Closed
vadymmarkov opened this issue Aug 23, 2016 · 6 comments
Closed

Aftermath and CQRS #4

vadymmarkov opened this issue Aug 23, 2016 · 6 comments

Comments

@vadymmarkov
Copy link
Contributor

vadymmarkov commented Aug 23, 2016

@zenangst @RamonGilabert @onmyway133

Some ideas were taken from CQRS https://en.wikipedia.org/wiki/Command–query_separation principle, but in general there is at least one fundamental difference - we don't separate a query layer that only returns data to the caller and a command layer that only updates the state. Aftermath is for front-end apps where both read and update actions go through the same flow:

Command -> Handler -> Event -> Reaction

With that being said, should we care about terms that could potentially lead people into confusion? For example, Command could be renamed to Intent or even Action.

@onmyway133
Copy link
Contributor

@vadymmarkov What does Command do in this flow?

@vadymmarkov
Copy link
Contributor Author

@onmyway133 Command is any kind of request from the view, could be "Load posts" or "Update post". It's handled by CommandHandler where all the business logic is, such as networking or database queries. When CommandHandler is done, it produces some response, either success or error, and publishes it to single/multiple event subscribers.

@zenangst
Copy link
Contributor

We could go with Action to avoid confusion.

@zenangst zenangst reopened this Aug 23, 2016
@zenangst
Copy link
Contributor

Ops, I totally closed by mistake, stupid jumpy subway ride.

@vadymmarkov
Copy link
Contributor Author

I was thinking about it and for me "Load post!" or "Update post!" are more commands than actions. So let's not make a problem from it, leave Command as a name and see how it goes.

@zenangst
Copy link
Contributor

I do agree with you here, but if you think about the flow that you referred to before;

Command -> Handler -> Event -> Reaction

The end result of an action is a reaction right? 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants