9

I have one general question about SPA.That is,Is SPA suitable only for the Dashboard kind of applications ? Or Can we use SPA for any size of Enterprise level application development (say for ERP solution)?

SPA

UPDATE :

Please check below link for GREAT discussions of this topic with John Papa,Dan Wahlin and others....

Single Page Application for Enterprise Level Systems

Sampath
  • 63,341
  • 64
  • 307
  • 441
  • It mostly depends on what tools/frameworks you use. SPAs are especially good if response/user experience speed is the most important thing. If that's not the case, then it might not worth the additional complexity that comes with SPA. – zmirc Oct 30 '13 at 10:14
  • @zmirc Yep,I would like to use AngularJs for that.What's your thoughts (I have shared a link above also)? – Sampath Oct 30 '13 at 10:16
  • @zmirc Lets say I can handle the complexity of such an implementation.But My question is,is that suitable for such a large App develop by using Javascript framework ? – Sampath Oct 30 '13 at 10:21
  • AngularJS is a very hot project that I've also used, but you come back to having all the logic in JavaScript, which will add complexity and pain if the project gets huge (it's enterprise). The rule of thumb is: the more complex/enterprise a software solution should be, the more you should use professional tools and static languages (Java/C#). Maintenance is 80% a software's life. Putting that in JavaScript might be very tricky. Refactoring, structure and developer independence are a little bit more difficult in scripting languages. – zmirc Oct 30 '13 at 10:22
  • 1
    @zmirc Yep,Great answer.I got your point.If you can put this as an Answer,I can Accept it.I'am sure It'll help a lot in future :) – Sampath Oct 30 '13 at 10:26
  • Hi Sampath, thank you for asking this question 6 years ago! With the experience you could build up since, how do you look at this topic now in 2019? Are given answers below still up to date? Thank you! – caramba Oct 22 '19 at 08:30
  • @caramba Yes, you can use it for any size or enterprise-level app without any issue. I highly suggest you use NGRX store and effects library also. It'll give great performance and debugging features to the Angular app. https://ngrx.io/ – Sampath Oct 22 '19 at 10:30
  • @Sampath thank you for the answer. How can you say yes and suggest to use some library when the most upvotet answer says: `"The rule of thumb is: the more complex/enterprise a software solution should be, the more you should use professional tools and static languages"` ? I mean, thanks for the suggestion but that only applies if we chose to write an SPA and not an MPA (MultiPageApplication/EnterPriseApplication)? – caramba Oct 22 '19 at 10:49
  • @Sampath if this gets more complicated and you have a few minutes please join this chat-room I just created: https://chat.stackoverflow.com/rooms/201255/spa-vs-mpa – caramba Oct 22 '19 at 10:53

4 Answers4

16

AngularJS is a very hot project that I've also used, but you come back to having all the logic in JavaScript, which will add complexity and pain if the project gets huge (it's enterprise).

The rule of thumb is: the more complex/enterprise a software solution should be, the more you should use professional tools and static languages (Java/C#).

Maintenance is 80% of software's life. Putting that in JavaScript might be very tricky. Refactoring, structure and developer independence are a little bit more difficult in scripting languages.

Some use cases where SPAs are a good approach:
1. When you want a high performance app for all types of mobile devices (if you can't afford native development and if you don't want to pay fees to Apple, Google, Microsoft when you sell stuff).
2. News sites where you want to engage the user as much as possible (www.usatoday.com is a great example).
3. Social networks where you must do everything possible to keep the user active (ex: Facebook is mostly SPA).
Bottom line for SPAs = fastest web performance & best user experience.

zmirc
  • 825
  • 2
  • 11
  • 27
  • One small question.Can you roughly recommend the systems Which SPA is suitable ? – Sampath Oct 30 '13 at 10:31
  • When you want a high performance app for all types of mobile devices (if you can't afford native development and if you don't want to pay fees to Apple, Google, Microsoft when you sell stuff). News sites where you want to engage the user as much as possible (www.usatoday.com is a great example). Social networks where you must do everything possible to keep the user active (ex: Facebook is mostly SPA). Bottom line = fastest web performance & best user experience. – zmirc Oct 30 '13 at 10:37
  • 3
    RE: "the more complex/enterprise a software solution should be, the more you should use professional tools and static languages (Java/C#)." ... I disagree that the rule is that simple. You can build "professional" apps with SPA and a multitude of other tech. It all depends on the app you build, the features, the reach, devices, and more. You can;t generalize. If you ask a specific question, we can answer. But this reply is incorrect. – John Papa Oct 31 '13 at 12:44
  • I disagree with this entirely way too grey area. AngularJS is enterprise ready sony, chevrolet, etc. are using it. If you use Plato for javascript to keep your complexity down and maintainability up it'll be a breeze. Check out Phonegap and you'll be fine just get your ideas out first and then cut them back into something simple. – Michael J. Calkins Nov 17 '13 at 18:23
  • 1
    I disagree as well. JavaScript is and has been ready for enterprise grade applications. We are building one ourselves. Initially started with MVC but are rapidly moving away from any server code on the client and only using MVC/Web API in our REST service layer - it is much cleaner and more maintainable approach than using HTML5, JavaScript AND some server tech on the client (which makes things more complex in my opinion). With frameworks such as Angular, Durandal, Kendo UI (our choice), etc it is very possible to write highly optimized and very maintainable JavaScript applications. – Vesselin Obreshkov Dec 17 '13 at 16:59
  • @zmirc Hi, Thanks to ur recommend. I read u guys recommend but I didn't understand in detail... so do u think Is it suitable for enterprise application like ERP, HIS(Hospital Information System)? In my case, we have more than 4,000 pages. and I'm wondering which is better between Tranditional Web and SPA – Adrian Oct 13 '16 at 02:14
  • @Adrian Hi! This is a totally subjective answer. First of all, it depends on what your team knows to use best. Secondly, due to the complexity and use case, I would go with (if Java) something like JSF with Primefaces, because of speed of development, maintainability and lifetime of the technology (most SPA frameworks appear today and die in 1-2 years or suffer radical changes). See http://www.adam-bien.com and http://primefaces.org – zmirc Oct 18 '16 at 14:08
  • @zmirc Thanks. so It depends on our system. If our system need to change sometimes, traditional web page can be better than SPA. Is it right?? Thanks again.! – Adrian Oct 20 '16 at 00:25
  • @Adrian Again, this is totally subjective. Yes. I wouldn't touch SPA in your case because it doesn't seem to require it, but not only. – zmirc Oct 20 '16 at 12:12
7

Great question. I really cut my teeth in SPA developing an enterprise mobile first application. I learned so much from the experience. The application had about 40 modules or apps,if you like. Each app had about 3-6 views. I realized early on that traditional web architecture would not cut it, remember it was a mobile first project, so I started doing a spa.

There is so much to it, and not enough or here to articulate, but it is not really that hard. Here are some principles I believe you have to stick with:

Avoid heavy frameworks, they get in the way too much and they come and go, so don't be married to them Vanilla JavaScript is your friend in many ways. All browsers are pretty consistent with supporting the same standards, Apis etc. Leverage local storage to cache data as well as markup Do not download large chunks of markup at one time Do not create an unnecessarily chatty application, localStorage and indexDB are your friends Create a mechanism to serve only modified markup content each time the app is loaded Keep your DOM small, too many elements, even hidden creates a sluggish machine starving for memory. Use appcache for offline, but understand its quirks

I general most of my enterprise apps can be done with 100kb of JavaScript or less, that is the entire application. My DOM is usually less than 100 elements baring a long list or table in the view. All my apps load in less than 1 second, and load sub module content in the background.

Chris Love
  • 3,740
  • 1
  • 19
  • 16
  • thnx I am actually trying to finish up a book pontificating the way I do it. Hopefully it will be available before December, time will tell. – Chris Love Nov 08 '13 at 18:19
1

A definite positive answer will only be possible if someone builds a successful ERP as single page application using Angular.

The Civilian web framework contains an elaborate sample [1][2] where the makers explored that direction. This seems not to be a complete solution but probably gets some steps closer to an architecture.

[1] http://www.civilian-framework.org/doc-samples.html#crm
[2] https://groups.google.com/forum/#!topic/angular/Q3GrhAH39AU

wero
  • 32,544
  • 3
  • 59
  • 84
0

For me Google Dart+Polymer claims to be used for ERP Development. But google is doing everything with Dart,Flutter,Dartino an just abandoned Polymer.Dart and teh Dart Editor.