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

Dealing with order in ViewModel composition #1

Closed
chris-pardy opened this issue Sep 14, 2018 · 4 comments
Closed

Dealing with order in ViewModel composition #1

chris-pardy opened this issue Sep 14, 2018 · 4 comments

Comments

@chris-pardy
Copy link

@mauroservienti Looking at CartIdAppender it seems like it must be run before other IHandleRequests or the cart-id cookie may not exist, and operations may fail. However I don't see this being dealt with anywhere. Is there a strategy for dealing with this?

@mauroservienti
Copy link
Owner

Hi @chris-pardy. Yeah you’re right, I was in hurry with the demo and that was the first solution that came to mind. CartIdAppender doesn’t sound like the solution I was looking for, ensuring that a Cart ID is probably someone else responsibility. Not to mention that it’s a technical requirement, I’ll give it more thoughts and as soon as I come up with a better design I’ll update this issue. Thanks.

@mauroservienti
Copy link
Owner

@chris-pardy I raised #2 as a different approach to solve the problem. I haven't changed the logic, but given that now the CartId generation is completely disconnected from the ViewModel Composition process, it can be changed to whatever different requirement.

@chris-pardy
Copy link
Author

@mauroservienti I think this approach makes sense. Giving some thought to our use case it feels like this idea works really well with CQRS so you should never have a case of needing to read data from 1 service before you dispatch a command to another service.

@mauroservienti
Copy link
Owner

Agreed. I’ll merge the PR and close this one then, feel free to reopen or raise other issues. Thanks!

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

2 participants