Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SF Ember.js Meetup 10/30

tomdale
October 30, 2012

SF Ember.js Meetup 10/30

In this talk, Tom drops some rapid-fire knowledge bombs about Ember Data–what it is, where it's at currently, and what's coming in the pipeline.

tomdale

October 30, 2012
Tweet

More Decks by tomdale

Other Decks in Programming

Transcript

  1. DS.Adapter DS.Serializer • Are relationships saved in the parent or

    the child? • What payloads are sent to what URLs? • What actions map to what HTTP verbs? • What is the name of the primary key? • What are the names of attributes? • Are objects embedded or referred to by ID?
  2. find: function(store, type, id) { if (type === App.Post) {

    $.ajax('/enterprise_cms/v134uu5/ db-legacy/posts_endpoint-v2/'+id, 'GET', { success: function(json) { store.load(type, json); } }); } else if (type === App.Comment) { $.ajax('/comments/'+id, 'GET', { success: function(json) { store.load(type, json); } }); } }
  3. // GET /comments/789 { "comment": { "id": 789, "title": "Browser

    question", "body": "the question, \"What browser am I using, and why does it matter?\"", "user": { "firstName": "Jeff", "lastName": "Chang" } } }
  4. // PUT /comments/789 { "comment": { "id": 789, "title": "Browser

    questions", "body": "the question, \"What browser am I using, and why does it matter?\"" } } // PUT /users/123 { "user": { "id": 123, "firstName": "Jeffrey", "lastName": "Chang" } } Embedded Loading
  5. // PUT /comments/789 { "comment": { "id": 789, "title": "Browser

    questions", "body": "the question, \"What browser am I using, and why does it matter?\"", "user": { "firstName": "Jeffrey", "lastName": "Chang" } } } Embedded