Classes should inherit from mixins
-
Kit Goncharov
A possible disadvantage of doing this is that we could easily end up with a long prototype chain, especially with multiple mixins and a superclass...
-
Radoslav Stankov
This could be useful (At least in Ruby is useful). The way ruby handles it is adding "something" like ghost classes which point to the mixin. In js we could use the same strategy.
I'm not sure if this could be done in performance wise ( I could be wrong ). I think I have seen something build whit inherit mixis here - http://jsclass.jcoglan.com, but for every mixin object is actually a class.
-
John-David Dalton
I didn't think of
mixinslike that. In fact I made them so they couldn't be used in a way to work with inheritance, (I have checks that stop it). -
John-David Dalton
FuseJS Class API
var SomeClass = fuse.Class(superclass, plugins, mixins, statics); SomeClass.addMixins({ ... }); -
John-David Dalton
Making them update when changed would require some kind of wrapper around the source method that then checks the real method:
//... 'someMethod': function() { return mixin.someMethod.apply(mixin, arguments); } //... -
John-David Dalton
- Milestone cleared.
- Tag set to enhancement
-
Kit Goncharov
- State changed from new to invalid
- Milestone order changed from 5 to 0
The general consensus seems to be in favor of keeping the existing Class API due to performance concerns and compatibility with the Prototype API. Closing as
invalid.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.