Hacker Newsnew | past | comments | ask | show | jobs | submit | finpingvin's commentslogin

The behaviour of clone has also change; instead of passing the whole instance to the constructor, it only passes the attributes. Could be worth noting for people who are upgrading (I hit an error because of that) :). Otherwise, great job!


Thanks for noticing -- I missed that in the commit logs. I've added a note about the change to the change log.


But if you're wiring together several views dependent on the selected state, this type of code can lead to spaghetti and tight coupling between views.


This is supposed to be an introductory tutorial on Backbone. That should not be a concern. Second, the author makes the claim that Backbone is an MVC and makes things simpler and yet violates that. His way you literally have to go through the view, the collection, the model, a trigger, and back to the view to select a new image. WTF?


It simply is a matter of concerns. Ideally, your model should represent the state of your application, it doesn't matter if an event needs to travel one or more layers in order for that to happen. Views may very well be a representation of the model. Although the MV* stack is packed with examples (MVC, MVP, MVVM), here is one example ('Passive View'): http://martinfowler.com/eaaDev/PassiveScreen.html


Yup, can simplify code for wiring together views a great deal and promote decoupling between them.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: