How should I organise an object to to keep everything as decoupled as possible?
<p>I am finally asking this question as I have never actually found an answer. If I have a javascript object with a structure such as this:</p>

<pre><code>var someObj = {

    "categoryA" : {
        "func1" : function(){},
        "func2" : function(){},
    },

    "categoryB" : {
        "func3" : function(){},
        "func4" : function(){},
    }

}
</code></pre>

<p><code>func4</code> wants to call <code>func2</code>. Do I have any way of calling it without saying <code>someObj.func2()</code>? It seems to me this is ugly since it is ensuring the application cannot be easily renamed and appears to be more tightly coupling the internal functions. Or is this just how it is typically organised and it is not seen as a problem?</p>
