REFERENCE
According to reference: Below is a more advanced version of the facade pattern that adds security to internal methods.
Question: Honestly what do they mean add security? Furthermore, what would be insecure example? Lastly, What would be a simple but real use case for security and this facade + revealing module pattern?
var MyModule = ( function( window, undefined ) {
// revealing module pattern ftw
function MyModule() {
function someMethod() {
alert( 'some method' );
}
function someOtherMethod() {
alert( 'some other method' );
}
// expose publicly available methods
return {
// in our normal revealing module pattern, we'd do the following:
someMethod : someMethod,
// in the facade pattern, we mask the internals so no one has direct access by doing this:
// HOW DOES THIS MASK THE INTERNALS? WHAT DO THEY MEAN BY ADDS SECURITY?
someMethod : function() {
someMethod();
}
};
}
} )( window );