title: Backbone.js pattern: When to load multiple resources?
body: <p>Most of the open Backbone.js single–page apps and demos out there seem to deal with one or maybe two different resources and usually populate the collections in questions when initially loading the page.</p>
  
  <p>How do you guys deal with multiple (more than 2 or 3) different resources having their data stored remotely? When do you load the content?</p>
  
  <p>An <strong>example</strong> which should sound familiar to Rails devs:</p>
  
  <p>A <code>current_user</code> object exists, having <code>has_many</code> associations to <code>Project</code>, <code>Team</code>, <code>Task</code> and <code>Invoice</code> models. My client–side app provides some kind of CRUD functionalities for these models, maybe some additional views to connect stuff, etc., having in total many different views and corresponding routes.
  I want the user to be able to jump straight to any of these routes by e.g. pasting a link, let's say <code>/#project/34/invoices</code>, which would require the app to have the Project with ID 34 loaded as well as the invoices connected to this project. </p>
  
  <p>How do people solve this issue, given that you can easily end up having many cases like this within a single app? Are you just loading everything initially</p>
  
  <pre><code>current_user: {
    projects: {
      invoices: {…},
      tasks: {…}
    tasks: {…}
    …
  }
  </code></pre>
  
  <p>which doesn't seem clean to me, or do you have a clever way to always load what you need?</p>
  
  <p>Cheers!</p>