Sometimes it seems to me that the Ember project has been influenced by Ruby and Rails conventions. I hope the developers are keeping an eye out for the rest of us! I’ve always wondered, for instance, why does ember-data (or is it the available adapters that support it – I can’t always tell them apart) want underscores in perfectly reasonable camel-cased object names? Is that a Rails thing?
In any case, I can see in github that AMD support is definitely a topic within the team, and I’m thankful for that.
On the other hand, there is definitely a disconnect between piling objects into the App object and using naming conventions to hook them up vs. the RequireJS “way” of doing things, but it seems reasonable to think that (at a high level):
- an App.Router depends on Routes
- Routes depend on the Views and Controllers that they connect
- Views depend on the Controllers that do the work for them and the Models they expose
- Controllers depend on the Models they manipulate
- Models depend on a Data Store
Obviously inter-connections exist as well, as needed.
Are the naming conventions worth it? I’m not sure. One point of AMD (I think) is to help stop pollution of the global namespace… well the naming conventions in Ember.js seem to just push the problem into the App object. If I can nail down the dependencies really clearly, I’d like to quit using the naming conventions altogether. I don’t know if this will even work, but I’m hopeful.