I'm reading a book about javascript patterns. When reading about the Revealing module pattern, I get confused about the disadvantages that the pattern implies.
Aren't the disadvantages of a simple module the same as the RMP ? Is there a code example that demostrates these disadvantages ?
I have pasted the text that talks about the downsides of this pattern, below. I am not sure how this differs from a common module.
Disadvantages
A disadvantage of this pattern is that if a private function refers to a public function, that public function can't be overridden if a patch is necessary. This is because the private function will continue to refer to the private implementation and the pattern doesn't apply to public members, only to functions.
Public object members which refer to private variables are also subject to the no-patch rule notes above.
As a result of this, modules created with the Revealing Module pattern may be more fragile than those created with the original Module pattern, so care should be taken during usage.