[Pkg-javascript-commits] [backbone] 211/281: expanding the section in the FAQ explaining why Backbone doesn't model associations / nested documents for you.

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:02:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9.0
in repository backbone.

commit 66d509f99a24c2c962e8b0618ae6a87e3788afda
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Tue Jan 17 11:16:25 2012 -0500

    expanding the section in the FAQ explaining why Backbone doesn't model associations / nested documents for you.
---
 index.html | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/index.html b/index.html
index 618bae6..94a5442 100644
--- a/index.html
+++ b/index.html
@@ -2786,6 +2786,36 @@ Inbox.messages.fetch();
       Backbone plugins that add sophisticated associations among models,
       <a href="https://github.com/documentcloud/backbone/wiki/Extensions%2C-Plugins%2C-Resources">available on the wiki</a>.
     </p>
+    
+    <p>
+      Backbone doesn't include direct support for nested models and collections 
+      or "has many" associations because there are a number
+      of good patterns for modeling structured data on the client side, and 
+      <i>Backbone should provide the foundation for implementing any of them.</i> 
+      You may want to…
+    </p>
+    
+    <ul>
+      <li>
+        Mirror an SQL database's structure, or the structure of a NoSQL database.
+      </li>
+      <li>
+        Use models with arrays of "foreign key" ids, and join to top level 
+        collections (a-la tables).
+      </li>
+      <li>
+        For associations that are numerous, use a range of ids instead of an 
+        explicit list.
+      </li>
+      <li>
+        Avoid ids, and use direct references, creating a partial object graph
+        representing your data set.
+      </li>
+      <li>
+        Lazily load joined models from the server, or lazily deserialize nested
+        models from JSON documents.
+      </li>
+    </ul>
 
     <p id="FAQ-bootstrap">
       <b class="header">Loading Bootstrapped Models</b>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list