Why SPA (single page application)?

Inspired by a video by John Papa at Pluralsight, I started learning SPA. It looks pretty interesting. However, before I jump up completely, I would like to clarify some of my questions.

  • From what I learned, SPA is a lean server, a thick client application. I think this should work well for small applications, as John Para demonstrated. Does it scale? How big can it be? Does anyone have any experience with this?

  • In SPA, you seem to code all the business logic in JavaScript. Is that a good idea? How do you hide the business "secret"?

With my experience mainly in C # / WPF / .NET, switching to JavaScript seems very difficult (well, I learned a bit of JavaScript more than 10 years ago - I hated it and never touched it again). With limited knowledge, I ran into several problems. JavaScript debugging seems like a nightmare to me. The highly rated Breezejs component seems to be still at an early stage (for example, it does not support UOW, does not support CascadeDelete, does not support enumerations). So, I wonder what is the right time to go?

+7
javascript asp.net-web-api breeze
source share
4 answers

Directly to your questions:

  • Since the server logic is thin, you can use some kind of cloud services, and they scale pretty well. Most of the logic will be handled by your users โ€™browsers.
  • You must be careful if you are dependent on the client. The HTTP protocol can be easily manipulated. Do not forget that you should always follow the verification logic both on the client side and on the server side! Also, "hidden" checks and other "secret" logic should only be located on the server.

JavaScript debugging is not so bad. You can use the built-in tools (Inspect element in Chrome and FireBug in Firefox, etc.). There are also many useful third-party tools to help you debug.

If you are starting a new project only for your own use, I advise you to try the SPA approach. If you write production code, you should become an expert in this field, and then try to use these technologies.

+8
source share

For UoW, take a look at the TempHire sample. It demonstrates the use of the UoW template on both the client and server.

https://github.com/IdeaBlade/Breeze/tree/master/Samples/TempHire

+3
source share

I believe that SPA provides a better framework for business applications, as well as simpler application workflows like Facebook. I worked with Multi Pages applications for a banking application with complex workflows, and it is difficult for him to cope with every task and still maintain application performance.

But I really think that Knockout Alone will not be able to handle large applications, as it is related to nature. I would recommend something like Backbone Marionete or Angular for this venture.

I am creating a framework for large-scale SPA development for the open source community, so I think this is the right direction.

Interested parties can go to my demo page at http: \ saqibshakil.imtqy.com. I demonstrated some of my work there.

+1
source share

I studied it for several months. My conclusion is to use a knockout with light path.js or sammy.js for your url. I am using json with the standard Visual Studio MVC (which can return Json) as the backend. I have not finished the project, but so far so good. It is lightning fast, elite and easy. Stay away from frames. Look at the standard libraries: how they are written; You can learn a lot. Finally, debugging using the chrome or explorer developer tools. Good luck.

0
source share

All Articles