moviepilot/chaplin — pull request #9 by molily (2012-03-08 22:46:46+00:00)
Title: Further Development

I made some changes on the core architecture as well as smaller changes and bundled them in this branch to discuss about them.

The most important thing is probably the split of the controller startup/disposal logic between ApplicationController and ApplicationView. I always felt that ApplicationView isn’t the right place since it’s not a *view* question, but a app-wide mechanism. ApplicationController as parent of other controllers makes more sense.

Second thing is the split between Router and routes. The routes used to lie in the Router class which is definitely not the right place. Now they are sourced out into a `routes.coffee` which looks much like the Rails counterpart `routes.rb`.

Third thing is the mediator revamp. `mediator.user` is now readonly in ES5-conformant browsers and the new `mediator.setUser` method should be used when setting the user. The idea is to prevent accidental overwriting. At least you will get a strict mode exception in ES5-capable browsers.

What do you think?