Does anyone recognise this javascript design pattern?
<p>This is a js pattern I've found myself using and tweaking over the years.</p>

<p>The thing is, I fell into it after some experimentation and I'm keen to know whether this type of pattern has a name. I've browsed through a lot of design patterns but not found anything similar (or as simple, especially for modular type patterns).</p>

<pre><code>var FOO = (function ($) {
    var privateFuncA = function() {
        ...
    },        
    privateFuncB = function() {
        ...
    },
    self = {
        init: function() {
            privateFuncA(); // Call a private func
            self.publicFunc(); // Call a public func
        },
        publicFunc: function() {
            ...
        }
    };
    return self;
}(jQuery));

$(function () {
    // Initialise FOO
    FOO.init();
});
</code></pre>

<p>Idea is to keep everything namespaced and allows for pseudo-public/private funcs.</p>

<p>If I need to go modular I'll extend the base FOO object:</p>

<pre><code>// Extend FOO object
FOO.Bar = (function ($) {
    var privateFunc = function() {
        ...
    },
    self = {
        publicFunc: function() {
            ...
        }
    };
    return self;
}(jQuery));
</code></pre>

<p>If you want to call publicFunc in the extended object from outside you can:</p>

<pre><code>FOO.Bar.publicFunc()
</code></pre>

<p>Does anyone know if this type of pattern has a name or whether there's any known issues with such a design?</p>
