|Written by Ian Elliot|
|Thursday, 02 December 2010|
Page 2 of 2
The object factory also provides the mechanism of prototype inheritance. Any object created by an object factory uses the object factory's prototype property in an attempt to find any method or properties it doesn't implement directly. By setting the object factory's prototype property to another object you can implement inheritance and by prototype chaining you can also implement an inheritance hierarchy. This might sound like standard object-oriented inheritance but it has its dynamic aspects. You can add properties and methods to the prototype object at run time and so what is inherited can change at run time.
This is inheritance but not as we know it.
A functional language
Shortcomings - well yes
|Last Updated ( Friday, 03 December 2010 )|