Thanks for your thorough answer! >> - If instance factory B inherits from instance factory A, is B a subclass of >> A? B a subtype of A? B a subconstructor of A? > > Your assumption points that you very likely mostly programed before in static > systems (such as Java, etc). Please refer this info to cover the topic > completely: > http://dmitrysoshnikov.com/ecmascript/chapter-7-1-oop-general-theory/ > > In ES, a "factory B" doesn't inherit from "factory A". Here only objects > inherit from their prototype chains. A "factory A" inherits from its > prototype chain (usually Function.prototype). > > If you though want to use concept of a class and create a useful sugar (class > system) for it and build your system using classes, then yes, you may say > that class B inherits from class A -- and it will be correct an this > abstraction level. In practice (i.e. on lower abstraction level), it will > just mean that an object created by the constructor B inherits from the > prototype which in turn inherits from the A.prototype.
I do understand all that! But the fact is that there are many functions like Node.js util.inherits() out there that make it seem like you can let one constructor inherit from another one. I’m just looking for the right words to express what is happening in such a case. -- Dr. Axel Rauschmayer [email protected] home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

