1

Can't Ember-data just see the JSON response it gets and understand by it which attributes are used by the server?
For example if the response for 'GET /api/user/1' is like:

{
    id: 1,
    first_name: 'Miki',
    last_name: 'Coco',
    age: 17
}

Its pretty obvious that the user model has just first_name, last_name and age.

Why would i need to configure it?

kfir124
  • 1,286
  • 4
  • 14
  • 27

1 Answers1

1

Here's the things that I can think of off the top of my head.

  1. Change management (isDirty)
  2. Serialization/deserialization of different types
  3. You can put other properties on the model that won't necessarily be sent back to the server on save etc
  4. Relationship handling

Honestly, I avoid Ember Data for simple models that I don't need CRUD for, it's overkill (unless I'm worried about client side caching etc)

Kingpin2k
  • 47,277
  • 10
  • 78
  • 96
  • Seems like it is an overkill for nosql too, are you using Ember-model? or just add your $.ajax methods? – kfir124 Jun 18 '14 at 17:10
  • one project we're using Ember Model, but when it comes to relationships it's overkill as well, I roll my own adapter using $.ajax... http://stackoverflow.com/questions/17938294/how-do-you-create-a-custom-adapter-for-ember-js/17938593#17938593 – Kingpin2k Jun 18 '14 at 17:12
  • I guess i'll roll my own too, the linked post will help me get started at it thanks :) – kfir124 Jun 18 '14 at 17:16