JavaScript Override Patterns
Once we have understood JavaScript Overload Patterns , a good start point to write efficient base classes, it comes natural to wonder about How To Override . First of all, please let me quote one of my favorite sentences from Mr D. I have been writing JavaScript for 8 years now, and I have never once found need to use an uber function. The super idea is fairly important in the classical pattern, but it appears to be unnecessary in the prototypal and functional patterns. I now see my early attempts to support the classical model in JavaScript as a mistake. Douglas Crockford, on Classical Inheritance in JavaScript Override In classical OOP, override means that a sbuclass can declare a method already inherited by its super class, making that method, the only one directly callable for each instance of that subclass. <?php class A { function itsAme() { $this->me = 'WebReflection'; } } class B extends A { function itsAme() { // B instances can acces...