I'm not suggesting drastic action. I don't want to break backwards compatibility. I simply want to make the class
feature more usable to a broader cross section of the community. I believe there is some low-hanging fruit that can be harvested to that end.
Imagine AutoMaker contained class Car
, but the author wants to take advantage of prototypes to enable factory polymorphism in order to dynamically swap out implementation.
Stampit does something similar to this in order to supply information needed to inherit from composable factory functions, known as stamps.
This isn't the only way to achieve this, but it is a convenient way which is compatible with .call()
, .apply()
, and .bind()
.