JavaScript Javascript revealing module pattern disadvantages javascript revealing module pattern,javascript revealing module pattern constructor,javascript

I have been reading about revealing module pattern in Addy Osmani's book. It highlights following disadvantage:

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.

I'm not an expert in JS and it is not making much sense to me. Also book doesn't provide any examples of these disadvantage comparing to module pattern.

I googled and found this on here:

Revealing module pattern disadvantages

which again I'm not able to grasp. As examples being used are using constructor functions.

Could someone please ELI5 please.

Answer:1

I have following html form: <form method="POST" action="uploadImage" enctype="multipart/form-data"> <input type="file" class="file" name="file"/> ...

I have following html form: <form method="POST" action="uploadImage" enctype="multipart/form-data"> <input type="file" class="file" name="file"/> ...

I am developing an app using jQuery Mobile with PHP. I am not using Phonegap or other frameworks. I need to find user's geolocation. If user device's GPS is off, then I cant get a location. now I need ...

I am developing an app using jQuery Mobile with PHP. I am not using Phonegap or other frameworks. I need to find user's geolocation. If user device's GPS is off, then I cant get a location. now I need ...

  1. check device user agent
  2. php check user device
  3. check point user device management
  4. check user agent mobile device

I have a very simple module that I am bundling with Browserify. I want to use that bundle both in the browser as well as in node. In node, it works just fine if I require the non-bundled module; ...

I have a very simple module that I am bundling with Browserify. I want to use that bundle both in the browser as well as in node. In node, it works just fine if I require the non-bundled module; ...

  1. require returns empty object
  2. node require returns empty object
  3. nodejs require returns empty object
  4. webpack require returns empty object
  5. require('fs') returns empty object
  6. javascript require returns empty object
  7. browserify require returns empty object
  8. require module returns empty object

I have the following iframe: <iframe name="content" src="" style="position: absolute; left: 0px; top: 28px;" allowtransparency="true" border="0" scrolling="yes" width="100%" frameborder="0" height=...

I have the following iframe: <iframe name="content" src="" style="position: absolute; left: 0px; top: 28px;" allowtransparency="true" border="0" scrolling="yes" width="100%" frameborder="0" height=...

  1. capture screenshot iframe
  2. javascript capture screenshot iframe