The router is the core of any Ember.js application and it can get big, fast.
Keeping your entire application’s router in one file is going to lead to madness. Thankfully it’s quite a simple problem to resolve.
Lets imagine an application with a number of discrete sections - a blog, a list of members and an area to browse uploaded files.
We have an init.js which sets up the application:
Looks pretty straightforward, but that’s without any outlet management, serializing/deserializing, action handlers etc…
Breaking this up is pretty simple.
Anywhere we say Ember.Route.extend we’re defining an anonymous class,
so in order to split up the router we can just give the class a name and move it to a file of its own.