Search code examples
javascriptbackbone.jsrequirejs

using global vars in big backbone apps


I have a rather general question, no code included. What would be the best architecture using backbone/requirejs for big Backbone Apps? Is it ok to have one global namespaces like App in which one can share all the necesary collections, models and views that are to communicate between each other? Or should I use just dependancy injection to load needed modules?


Solution

  • You should avoid global vars if you want your code to be reusable and modular