4 ms·
So you renamed "controllers" to "operations".
by rorrr 14y ago
So you renamed "controllers" to "operations".
- trebor 14y agoNo. An operation appears to be a one-off "action" rather than a collection of actions (like a controller).
- alttab 14y agoThis is a small difference. You can say that an operation is simply a controller with one method in it.
- bradwestness 14y agoSo basically he's just putting the controller methods in their own namespace. Which is all well and good, but I don't think anybody argues that all of your business logic has to be in the controller class for it to be considered MVC.
- pestaa 14y agoIt splits controllers into operations and events. Out of the three terminologies (state, representation, flow), the third one is arguably the most tangled. I find it healthy to refactor it into reusable chunks (operations) and event-driven flow management. The problem was, in my opinion, that operations should have not been put into controller units. It attracted more copy-paste solutions in my experience.
- utilitron 14y agoWhat is the difference between that and adding a service layer to a MVC?
- rcgs 14y agoThere isn't, but then is MVC really MVC when you've added in another layer?
- cbsmith 14y ago> It splits controllers into operations and events. The original MVC designs and sample code all had views and controllers observing models through an Observer based event pattern. The operations were the controller units. The events were not.
- 1qaz2wsx3edc 14y agoYah, this reminds me of Ember.js "MVC". It's kind of like "MOVE" + a StateMachine. http://emberjs.com/images/ember_mvc/embermvc.png http://emberjs.com/images/ember_mvc/embermvc.png Operations are similar to controllers for sure. But where's routing or state? We don't have a full picture here. After trying out that new meta-pattern, things get overly coupled, too many bi-directional relationships between state, views, models, and controllers/operations.
- divtxt 14y agoAnd callback "events" have been renamed to... "events". I'm going to have to agree with the parent here. Without example code to compare, how is this different than MVC? (or "MVCE")
- dclowd9901 14y agoAnd am I incorrect in seeing it as simply MVC with an events bus? Welcome to everything backbone.js already brought to the table.
- sic1 14y agoMy thoughts exactly. Extend your main app var with Backbone.Events and u have a global event system. app.trigger 'boom'
- drone 14y ago... I'm pretty sure typical MVC uses some form of event as well, i.e. an event is created to inform the view that the model has changed. (Even the wikipedia page differentiates passive MVC implementations where the language/platform cannot implement events.) Somehow, I'm just seeing the Observer pattern and the MVC pattern in the OPs post.