Javascript – Are JavaScript MVC Frameworks only for ‘single-page’ apps

Architecturejavascriptmvc

I've been looking into several of the JavaScript MVC Frameworks (Backbone.js, Spine, SproutCore,etc.) and it seems to me that all of these are designed to act as 'single-page' applications. All of the examples I see have an index page that act as a front controller, and use # or #! style URLs for different pages, and handle the entire rendering of the page.

I have several projects where I would like to use a more 'traditional' style of URLs, and having more structured JavaScript to handle some of the more complicated parts of the application. are JS MVC frameworks the answer here, or should I be looking for something different?

Best Answer

JavaScript MVC is just a code organization pattern.

They happen to work well with SPA but they can be used in normal applications.

However you don't actually need a JS MVC framework. You can just write modular JavaScript using some kind module loading strategy.

As long as you separate modules into separate objects / functions / units the code should be structured and clean.

Related Topic