title: What's the best way to override Model.get(attr) in Backbone.js?
body: <p>I'm using Backbone.js for the first time, and liking it so far. One thing I can't work out at the moment in dynamic attributes of models. For example, say I have a Person model, and I want to get their full name:</p>
  
  <pre><code>var Person = Backbone.Model.extend({
    getFullName: function () {
      return this.get('firstName') + ' ' + this.get('surname');
    }
  });
  </code></pre>
  
  <p>Then I could do <code>person.getFullName()</code>. But I'd like to keep it consistent with the other getters, more like <code>person.get('fullName')</code>. I don't see how to do that without messily overriding Person#get. Or is that my only option?</p>
  
  <p>This is what I've got so far for the overriding option:</p>
  
  <pre><code>var Person = Backbone.Model.extend({
    get: function (attr) {
      switch (attr) {
      case 'fullName':
        return this.get('firstName') + ' ' + this.get('surname');
        break;
      case 'somethingElse':
        return this.doSomethingClever();
        break;
      default:
        return Backbone.Model.prototype.get.call(this, attr);
      }
    }
  });
  </code></pre>
  
  <p>I suppose it's not terrible, but it seems there should be a better way.</p>