3 ms·
This architecture seems great for analytics apps, but when expanded beyond that (e.g., Pete Hunt's Full Stack Flux talk) I never see explanations of basic patte
by tristanz 12y ago
This architecture seems great for analytics apps, but when expanded beyond that (e.g., Pete Hunt's Full Stack Flux talk) I never see explanations of basic patterns like validation. Where does validation happen and how are errors sent back to users?
For instance:
AddToCart(prod=1, quantity=1) -> Transactionally check that there is still inventory, return error if there isn't, add to stream if there is.
- jpatte 12y agoThis is where the distinction between commands and events is important. "AddToCard" is a command (which might fail), while "AddedToCart" is an event that will result from processing only if the command passed validation. You should store events, not commands.