Pseudo-classical Inheritance in JavaScript for Modules
The classical design of object in JavaScript may look pretty clumsy. So I prefer the module design propagated so indefatigably by Addy Osmani (addyosmani.com/largescalejavascript/). We keep all the declarations within the function body. Public members placed in the object, which the constructor function returns. It looks much nicer. But, here shows up a problem. Common implementation for inheritance doesnt work on such objects. Lets study how exactly JavaScript instantiates objects and come up with a solution for our requirements.