Solved! Go to Solution.
We recommend using Dojo's tools for creating classes and modules to manage your code when you start building large apps. Our Dojo and AMD page is the best place to start. You'll find links to writing classes and widgets from there.
Regarding MVVM, we don't typically recommend MVVM, MVC or any other flavor of MVW (model-view-whatever). You can use any MVW framework alongside our API, including Backbone, Angular, Ember...the list goes on. Here's a repo that Matt Driscoll and I put together for examples using Backbone, Angular and Knockout at the Esri Dev Summit earlier this year: https://github.com/driskull/framework-samples-js
To your last point, about "single responsibility principle for the scope of require([])", I think the answer is yes, if I understand correctly. Typically, in things that I build, I create classes (one per AMD module) and then wire them up with a main.js or app.js file which contains a single require(). I don't typically put anything in the global namespace except when debugging. If I find myself with a huge list of dependencies for any require() or define() call, I take that as a sign that it's probably time to refactor and that I'm trying to do too much at one time.
If I find myself with a huge list of dependencies for any require() or define() call, I take that as a sign that it's probably time to refactor and that I'm trying to do too much at one time.
...
To your last point, about "single responsibility principle for the scope of require([])", I think the answer is yes, if I understand correctly. Typically, in things that I build, I create classes (one per AMD module) and then wire them up with a main.js or app.js file which contains a single require(). I don't typically put anything in the global namespace except when debugging. If I find myself with a huge list of dependencies for any require() or define() call, I take that as a sign that it's probably time to refactor and that I'm trying to do too much at one time.