News for hackers. Stuff that matters.
Re:Single Page Web Apps with Backbone.js by thomasdavis on Thursday March 15, 2012 @10:30PM (#3711671)
No one else has mentioned using a view manager/factory to handle the life cycle of views?

instead of

  var view = new SomeView(options);

  view.render();
we do

  var view = Vm.create('some descriptor', SomeView, options);

  view.render();
The factory/manager can do many things! List out active views, clean up all views at any stage during their life cycle, default cleaning methods etc etc
Re:Single Page Web Apps with Backbone.js by stusmith1977 on Friday March 16, 2012 @06:00AM (#3712629)
Agreed. Always keep SRP in mind. In effect, this is IoC for views. Having a separate manager to manage views and their lifetimes is very useful. Need a popup dialog view? Manager handles it. Views have prerequisite views (like sign in, or loading)? Manager handles it.