Closed ghost closed 9 years ago
Hi Yi-Hsiao,
Thanks for commenting! The reason is to simulate Java static methods in which static methods are accessible on both class and instance levels. It was a design decision being made since I started jsface (side note: I have Java background).
I later realized I never use static properties (methods and variables) on instance level :). Agreed that it could be better to make static them accessible on class level only.
If nobody's against it, I'll make a change.
Thanks for the explanation. I suggest that you bump the version major number if this change does happen so as not to break current use cases.
Fix in 2.4.0. Thanks everyone!
Hi there,
I love the library so far. Any reason why static methods are inherited at the instance level? It seems better for performance & encapsulation, if class/static methods only belong to the class. Would love to understand the philosophy behind this implementation.
Best, Yi-Hsiao
Relevant lines of code: https://github.com/tnhu/jsface/blob/master/jsface.js#L138 https://github.com/tnhu/jsface/blob/master/jsface.js#L153