This screencast : http://www.embercasts.com/episodes/getting-started-with-ember-model used Ember.model
to create a person model like this:
App.Person = Ember.Model.extend({
name : Ember.attr()
})
The docs give this example using Ember.Object
App.Person = Ember.Object.extend({
say : function(thing) {
alert(thing);
}
});
Further, under defining models section this example is given which uses DS.model
App.Person = DS.Model.extend({
firstName: DS.attr('string'),
lastName: DS.attr('string'),
birthday: DS.attr('date'),
fullName: function() {
return this.get('firstName') + ' ' + this.get('lastName');
}.property('firstName', 'lastName')
});
What is the difference between these three and when to use which?
As stated in this very illustrative article on Ember.Object:
Almost every object in Ember.js is derived from a common object: Ember.Object. This object is used as the basis for views, controllers, models, and even the application itself.
This simple architectural decision is responsible for much of the consistency across Ember. Because every object has been derived from the same core object, they all share some core capabilities. Every Ember object can observe the properties of other objects, bind their properties to the properties of other objects, specify and update computed properties, and much more.
Now to the differences and when you might use them depending on your use case.
Ember.CoreObject
with the Ember.Observable
mixin applied.Ember.Object
Ember.Object
Hope it helps.