I've been reading lately about SPA and how good it is.. I was wondering if someone could tell when should I use or even better when shouldn't I use SPA as go with regular MVC
The tooling for MVC (Rails, MVC4) is much more mature. There is far more documentation focusing on the development of traditional MVC sites. Single Page Application development is HARD. JavaScript-dense applications are difficult to write and can be extremely difficult to debug.
If you want to jump into SPA, look into John Papa's video training series on Pluralsight.com - which, to my knowledge, offers the best starting point for developing SPA apps. Or study Backbone, but that's simply not for the faint (feint?) of heart.
One futher suggestion: if you're a ASP.Net developer, look into BreezeJS (http://www.breezejs.com) for data management.
This blog post gives a good overview of some of the potential issues with SPAs, along with some suggestions for workarounds.
The potential issues include:
Browsers are not the best species in memory handling and garbage collection. Specially when it comes to DOM handling. For example, elements removed from DOM are stil held in memory. If we let users to work on DOM for a long time without a refresh, Browser might struggle to cop up with memory issues
We should ideally reuse as much as DOM elements without disposing. But even with that approach, if the user creates thousands of reusable DOM elements as she uses the application, browser may suffer in coping up. On the other hand, the memory leaks created by bad coding practices will too pile up in a long lived DOM.
If we need the complete product suite functionality to be available as a single page application, it can be too much of JS/CSS code to be loaded at once impacting the initial load time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With