Open jrhorn424 opened 8 years ago
Is this solved more cleanly with a computed property? Is it too soon to talk about that with this talk?
@jrhorn424 The current example is beetlejuicing, we should definitely remove it.
This example in particular
const Person = Ember.Object.extend({
fullName: function(){
return `${this.get('givenName')} ${this.get('surname')}`;
}
});
let bob = Person.create({
givenName: 'Bob',
surname: 'Belcher'
})
bob.get('fullName')(); // 'Bob Belcher'
The principle driving this issue is called "The Principle of Uniform Access".
It helps that adhering to this principal will avoid bugs, and that breaking this principle in Ember will break your application code in odd and hard-to-debug ways.
As a specific example for execution done wrong in this talk: