5

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?

1 Answer 1

3

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.

3
  • I believe the Steal framework can help out with the module loading Dec 9, 2011 at 20:21
  • Steal/RequireJS, scripts and namespaces, and script packagers and dependency managers are all popular module loading strategies. I would actually recommend against steal if your not using javascriptmvc.
    – Raynos
    Dec 9, 2011 at 20:24
  • Where does the business logic sit in a modular pattern? Would it be in it's own main logic module which is loaded in on application init? Jan 24, 2015 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.