3 ms·
It doesn't look like there's any separation between the model and the view, so in what sense is this MVC?
by couchand 12y ago
It doesn't look like there's any separation between the model and the view, so in what sense is this MVC?
- dreamdu5t 12y agoIt's not MVC. There are no controllers, and data in a Backbone app does not flow in a circular fashion. I consider Backbone views describable as presenters, and Backbone describable with the Model-View-Presenter (MVP) pattern. MVP diagram: http://lostechies.com/derickbailey/files/2011/12/NewImage2.png http://lostechies.com/derickbailey/files/2011/12/NewImage2.p... Why Backbone is not MVC: http://lostechies.com/derickbailey/2011/12/23/backbone-js-is-not-an-mvc-framework/ http://lostechies.com/derickbailey/2011/12/23/backbone-js-is...
- couchand 12y agoNot sure if your comment is directed towards me or the OP. However, there is in fact a Controller class in this project, so you may be confusing this framework for vanilla Backbone?
- weego 12y agoThere is a Controller class, but in the demo app you can see that both App and ToDoItem extend Controller, which makes be believe that Controller is perhaps not what you'd expect. Having said that, I much prefer Backbones presenter idiom over MVC.
- akrymski 12y agoIt's very much an MVC framework
- akrymski 12y agoViews are just DOM nodes. Models are completely separate.
- couchand 12y agoAh, I hadn't even clicked through to index.html, assuming it was just boilerplate. Now that I've looked at it a bit more, I have to echo the other commenter who asked about routing, particularly since the view markup is statically on the page. Perhaps I'm missing something?
- akrymski 12y agohttps://news.ycombinator.com/item?id=8597753 https://news.ycombinator.com/item?id=8597753