Store design question


#1

Say I have an application that requests a list of items from an external web service, I display them in a table and a user can select one of the items which then presents them with a view that has buttons on it where they can perform an action (i.e. update the status of an item, delete it, fill in additional info about it and submit it). The resulting action sends a message to an external service and the return is a confirmation of receipt (success/error). Would this resulting action message that I send be implemented in the same store that I get the original list of things back from or a different one? Or would it not be implemented with a store model at all?


#2

Yes, you would definitely implement any communication with the back end in a store object, and you would most likely be implementing the method in the same store, because you are talking to the same back end about the same type of data.

The store would initiate the request as well as parse the success/failure message. It would execute the block provided by the controller depending on the success or failure of the service.