yui/yui3 — pull request #323 by ericf (2012-10-24 19:02:31+00:00)
Title: Model Observable — Extracts Model's observability out into a mixable extension.

Similar the changes which extracted the `Y.BaseObservable` class extension out of `Y.Base`, this refactor extracts `Y.Model.Base` and `Y.Model.Observable` from `Y.Model`.

Model.Base extends BaseCore which creates an event-less model class which is not observable by default. There are situations where observability is not required and its overhead can be avoided; the most interesting of which is when using YUI Models in a Node.js server.

Model.Observable is a mixable class extension for Model.Base, which uses BaseObservable and enables developers to add observability to their basic models. The interesting feature here is that Model.Observable can be mixed-in at runtime. Consider the following example:

```javascript
// Define the FooModel class.
Y.FooModel = Y.Base.create('foo', Y.Model.Base, []);

// Some later point…
Y.Base.mix(Y.FooModel, [Y.Model.Observable]);

var foo = new Y.FooModel();

foo.after('change', function (e) {
Y.log('foo has changed.');
});

foo.set('bar', 'bar'); // => "foo has changed."
```

The functionality of `Y.Model` remains the same, it now simply extends Model.Base and mixes-in Model.Observable. Therefore these changes maintain backwards compatible with existing versions of YUI's Model class.

### Running Locally

The built `app` and `yui` modules are intentionally not included in this pull request in order to keep the diffs clean. Before testing this change, you'll need to build them.

```bash
$ cd src/app && shifter
$ cd .../yui && shifter
```

### Todos

* Update the Model User Guide.
* Update change history.
* Remove Attribute hacks.
* Determine if `Y.Model` should _extend_ or _use_ `Y.Model.Base`.