It has been a few weeks (ok, a few months) since my last blog post on JavaScript design patterns. I'd apologize, but frankly, it will probably be a few more weeks until I blog on this subject again, so hopefully people aren't expecting a...
It has been a few weeks (ok, a few months) since my last blog post on JavaScript design patterns. I'd apologize, but frankly, it will probably be a few more weeks until I blog on this subject again, so hopefully people aren't expecting a fast series here (grin). As a reminder, the idea behind this series is to create real, practical examples of various JavaScript design patterns based on the book, "Learning JavaScript Design Patterns" by Addy Osmani. (See my review here.) In this blog entry I'll be discussing the Revealing Module pattern.Addy Osmani describes the Revealing Module pattern as:
The Revealing Module pattern came about as [Christian] Heilmann was frustrated with the fact
that he had to repeat the name of the main object when he wanted to call one public
method from another or access public variables. He also disliked the Module pattern's
requirement of having to switch to object literal notation for the things he wished to
make public.
There's two main issues here. First, the concept