title: Help With Scalable JavaScript Application Architecture and Chaining
body: <p>I'm currently trying to roll my own javascript application architecture based off of the recommedations by <a href="http://yuilibrary.com/theater/nicholas-zakas/zakas-architecture/" rel="nofollow">Nick Zakas</a> and I am using jQuery as the base library.  I have everything pretty much working but it dawned on me that I have lost the ability to chain methods togeather since you ask the sandbox for methods using the dot notation.  Is there a good solution to this? See below for more details.</p>
  
  <pre><code>...register module...
  
  sandbox.click('p', function(){..});
  
  ....
  </code></pre>
  
  <p>Each module gets an instance of the sandbox which is created when the module is registered.  The Class is just a thin piece of code that translates module requests into core actions. </p>
  
  <pre><code>Sandbox.prototype = {
      click : function(el,cb){
          return Core.click(el,cb);
      }
  }
  </code></pre>
  
  <p>In the core I'm returning a bunch of available methods.</p>
  
  <pre><code>... Private members above
  return {
     click : function(el, cb){
        $(el).click(cb);
     },
     ... more public methods
  }
  </code></pre>
  
  <p>So currently I have no means of chaining methods together because the accessor will not have any of the other methods I want to chain to it.  If anyone has any ideas that would be great.</p>