"LuaJIT's interpreter () beats V8's JIT compiler" - Mike Pall
lambda-the-ultimate.org55 pointsby petermichaux17 comments
maria.ElementView.subclass(myApp, 'MyView', {
uiActions: {
'click .alpha' : 'onClickAlpha' ,
'mouseover .beta': 'onMouseoverBeta'
},
...
That auto-generates two methods on the view that forward handling to the controller. myApp.MyView.prototype.onClickAlpha = function(evt) {
this.getController().onClickAlpha(evt);
};
myApp.MyView.prototype.onMouseoverBeta = function(evt) {
this.getController().onMouseoverBeta(evt);
};
So it is actually the view that handles the DOM events. maria.ElementView.subclass(myApp, 'MyView', {
uiActions: {
'click .alpha' : 'onClickAlpha' ,
'mouseover .beta': 'onMouseoverBeta'
},
properties: {
onClickAlpha: function(evt) {
// not sending evt to the controller
// and controller method name is different
this.getController().onSomething(1, 2, 3);
},
onMouseoverBeta: function(evt) {
alert('no controller involved here');
},
...
Also about who should query the form data: the view or the controller. I believe the view should be the only player in the game that knows about the DOM. If the way that the form data has to be retrieved from the DOM changes, then only the view needs to be updated. This makes sense to me as the view is the one that creates the form so the view should encapsulated all access to the form.