Wednesday, 15 April 2015

javascript - Monolithic Backbone Router -


I am currently learning these inputs and exclusions, but I can still use the following router patterns or some variation About this:

  var MyRouter = backbone.Router.extend ({path: {'foo /: id': 'foo', 'bar /: id': 'bar', '': 'Index'}, foo: function (id) {/ * ... *}, bar: function (id) {/ * ... *}, index: function () {/ * .. . *}}};   

I fully understand what is happening here, but with this method I have a serious concern that I have not come for resolution (so far). In the application of any significant size, designating all of its routes in one place is to create a monolithic router. Not only in relation to their own routes, but also (obviously) the necessity that the controllers are part of all router.

How can I go about organizing routes for a massive, modular application in Backbone .js?

PS If someone can point me to backbone.js tutorial or an example app that is not trivial and is full of bad behaviors, I would be grateful.

You can see how he organized his app in the module, each of them has a router to deal with Takes care of The concept of modules in the merienttext is used by requirejs to load part of the code with some requirements.

Even if you are not going to use the meriannet and just stick to the spinal cord, then you have some useful insights into how useful it is to split your code, though I have to evaluate you Give suggestions

No comments:

Post a Comment