title: How do I use namespaces in Backbone with RequireJs
body: <p>I am unsure how I use namespaces in an modularized (RequireJs) Backbone environment.</p>
  
  <p>I have thought a bit how it <strong>could</strong> look like but am totally unsure if this is the right way.</p>
  
  <p><strong>app.js</strong> (getting executed by main.js)</p>
  
  <pre><code>define('App', ['underscore', 'backbone', 'Router'], function( _, Backbone, Router){
      function initialize(){
          var app = {}; // app is the global namespace variable, every module exists in app
  
          app.router = new Router(); // router gets registered
  
          Backbone.history.start();
      }
  
      return { initialize: initialize }
  });
  </code></pre>
  
  <p><strong>messages.js</strong></p>
  
  <pre><code>define('MessageModel', ['underscore', 'backbone', 'App'], function(_, Backbone, App){
      App.Message.Model; // registering the Message namespace with the Model class
  
      App.Message.Model = Backbone.Model.extend({
          // the backbone stuff
      });
  
      return App;
  });
  </code></pre>
  
  <p>Is this the right approach or am I fully on the wrong way (if yes please correct me!)</p>