index.mustache revision e7a06bba9e5e9412d43dc526c18d6de880571ae5
<div class="intro">
<p>
Model is a lightweight `Y.Attribute`-based data model with methods for getting, setting, validating, and syncing attribute values to a persistence layer or server, as well as events for notifying listeners of model changes.
</p>
<p>
The `Y.Model` class is intended to be extended by a custom class that defines
custom model attributes, validators, and behaviors.
</p>
</div>
{{>getting-started}}
<h2>Conventions Used in this Guide</h2>
<p>
This guide spends a lot of time talking about classes, subclasses, and instances of those classes and subclasses. To avoid confusion and unnecessary verbosity, the following conventions are used:
</p>
<ul>
<li><p>`Y.Model` (in monospace) refers to <strong>a specific class, and not a subclass</strong>. In other words, it refers only to the `Y.Model` class, and not to a `Y.CustomModel` class that extends `Y.Model`.</p></li>
<li><p>Model (with initial caps) refers to <strong>a class or any subclass of that class</strong>. For instance, "Model" could refer to `Y.Model` or to a `Y.CustomModel` class that extends `Y.Model`.</p></li>
<li><p>model (without initial caps) refers to <strong>an instance of a class or subclass</strong>. So "model" could mean "an instance of `Y.Model`" or "an instance of a `Y.CustomModel` class that extends `Y.Model`".</p></li>
</ul>
<h2>Using Model</h2>
<h3>Extending `Y.Model`</h3>
<h3>Model Attributes</h3>
<h3>Model Events</h3>
<h3>Model Methods</h3>
<h3>Validating Models</h3>
<h2>Implementing a Sync Adapter</h2>