Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SPA, the bad things?

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

like image 206
Tsahi Avatar asked Jan 15 '13 21:01

Tsahi


2 Answers

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.

like image 194
CCPony Avatar answered Nov 03 '22 22:11

CCPony


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.

like image 31
Brett Postin Avatar answered Nov 03 '22 23:11

Brett Postin