Clarification: Remote Model, Local Store?
I've been playing with (and enjoying) Sencha Touch, but now I'm moving into communicate with a server side of things.
It looks awesomely supported so far, but I need a little clarification.
Q: Models are for pulling data from a remote server, and Stores are for keeping an instance of that data cached locally?
Q: Why do I sometimes see a proxy: on the Model and other times on the Store?
- Does the Store data persist? As in, does it save to the device?
Q: To help me better wrap my mind around this local/remote difference, can someone provide a simple proof of concept code example showing this behavior:
- Can they both have a proxy? What kind of effect or functionality does this produce/provide?
Is the remote/local discrepancy of this simple example something that can provide insight into the different roles that Models and Stores play in an app?
- Create a "User" data. name, email, phone
- Save the User data:
- Update the data on the remote server
- Update update the data locally (on the device) as well
- Load the User data:
- If the data is present locally on the device, load it
- If the data isn't present locally on the device, pull it from the server and store it locally