What is meant by “public function can’t be overridden if a patch is necessary.” in Addy’s description of the Revealing Module Pattern?

Compare an object created by using an object literal to one created by the Revealing Module Pattern. Here is one created as an object literal. function makeGreeter(name){ return { getName: function(){ return name;}, sayHello: function(){console.log(“Hello, ” + this.getName());} } } var greeter = makeGreeter(“Danny”); greeter.sayHello; // “Hello, Danny” greeter.getName = function(){ return “George”;} greeter.sayHello(); // … Read more

JavaScript design pattern: difference between module pattern and revealing module pattern?

There are at least three different ways to implement the Module Pattern, but the Revealing Module Pattern is the only Module Pattern descendant that has an official name. The Basic Module Pattern The Module Pattern must satisfy the following: Private members live in the closure. Public members are exposed in the return object. But there’s … Read more