I read Javascript Design Patterns and then a bunch of SO answers on RMP, and I keep finding that when a flaw is mentioned, this is a quote from a book:
The disadvantage of this template is that if a private function refers to a public function, this public function cannot be overridden if a patch is required. This is due to the fact that a private function will continue to refer to a private implementation, and the template does not apply to public users, but only to functions.
Public elements of an object that reference private variables also obey the no-patch rule.
As a result, modules created using the Revealing Module template may be more fragile than those created using the original module template, so care should be taken during use.
Sorry I'm stupid, but the above explanation just doesn't do it for me. Can someone provide a code-rich visual example of what this flaw means?
james source share