If you have worked much with Ember-Data, then you know the buffered object proxy pattern:
http://coryforsyth.com/2013/06/27/ember-buffered-proxy-and-method-missing/
This pattern allows us to put changes to a model into a buffer instead of on the model itself. There are several benefits of this:
- If the model has changes come from a push source (an attribute is updated), the changes will not destroy what the user is currently entering.
- Saves can be de-coupled from dirty tracking. If you are saving a model as a user types, the model in flight will not accept changes from the user. You will get the dreaded
cannot change an object inFlight
error. With a buffer, you can commit the buffer to the model and save the model, then allow the user to keep making edits against a new buffer. No conflict. - In general, a buffer allows you to treat Ember-Data records more like database rows. You lock them for modification (while persisting them) but only for the shortest time possible. An object is made dirty then sav