You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a big one because this is Lavaca's classical inheritance mechanism. My argument for removing it would be to reduce complexity by removing one level of abstraction. It also hides dependencies because classes do not directly depend on it (it adds a method called extend to passed constructors). We only use single inheritance, so Javascript's own prototypal inheritance via Object.create() would accomplish the exact same thing in the same number of lines.
It implicitly touches everything we call a "class", through the .extend() method it adds to the passed constructor function. Directly it only touches util/Promise and util/Disposable.
The text was updated successfully, but these errors were encountered:
Bummer. I just noticed that we use the this.constructor property once in mvc/Model:325. That makes vanilla prototypal inheritance more boilerplate-y... example:
varTestModel=function(){Model.apply(this,arguments);};TestModel.prototype=Object.create(Model.prototype);TestModel.prototype.constructor=TestModel;mixin(TestModel.prototype,{idAttribute : 'myId'});// vs how it is currently:varTestModel=Model.extend({idAttribute : 'myId'});
We can put this on the back-burner. Maybe use es6 classes through traceur? If nothing else, I think it might be nice to modify util/extend to not add a .extend() method to every class so that scripts must require it to use it (avoid hiding dependencies, that is)... might make a separate issue.
This is a big one because this is Lavaca's classical inheritance mechanism. My argument for removing it would be to reduce complexity by removing one level of abstraction. It also hides dependencies because classes do not directly depend on it (it adds a method called
extend
to passed constructors). We only use single inheritance, so Javascript's own prototypal inheritance viaObject.create()
would accomplish the exact same thing in the same number of lines.It implicitly touches everything we call a "class", through the
.extend()
method it adds to the passed constructor function. Directly it only touches util/Promise and util/Disposable.The text was updated successfully, but these errors were encountered: