How to create global, instance based objects from local scope?
<p>I have a single global object I use.  I know the cons of using global objects but in this case I want to use it.</p>

<p>I call this global object the object pipe b.c. it branches my models to my controller and vice versa...maybe should have called it object branch...anyways...</p>

<p>The mistake I made is that I thought I only had one model running at any given time...but I don't, there are multiple.</p>

<p>Hence I can't use a single static implementation, I need and instance based one, one global object pipe per each model running.</p>

<p>Here is the static versions.  MC stands for Model/Controller.</p>

<pre><code>/********************************************************************************************
 *
 * MC - Model/Controller Types
 *
 *******************************************************************************************/

var MC = {};

/**
 **  Object Pipe
 */

MC.o_p = {
    model  :  'default',
    result :  'continue',
    page   :  {},
    args   :  {},
    server :  {},
    hash   :  localStorage.hash
};
</code></pre>

<p>I thought about doing something like this:</p>

<pre><code>MC.o_p1 = function() {
    return {
        model  :  'default',
        result :  'continue',
        page   :  {},
        args   :  {},
        server :  {},
        hash   :  localStorage.hash
        }
}
</code></pre>

<p>but now the return object is in local scope to whatever called it.</p>

<p>I need global instance based objects.  </p>

<p>I'm not sure if I'm over thinking this or what I'm asking is possible?</p>
