Modern Web: SPA / REST [closed]

1

Speaking on the modern web, we have new concepts like SPA / Rest and I keep some doubts.

Is the correct way to enter the web to focus / study these concepts? Since they appeared as an improvement on some old concepts.

Is it always feasible or when you can use SPA / Rest? I know that with a rest in hand I can use it to serve several other applications, such as mobile apps, out of stability and etc.

In safety, is it safe to use a SPA? In a lecture on SPA, that validation focuses on the front, but I would not stop doing the validation on the server, I think there's no point in doing this.

I speak in systems of all contexts, sizes, goals and so on.

I know that many of these things are not so new, being present on the web for a long time, but many "old" concepts are still proposed.

    
asked by anonymous 24.09.2016 / 16:47

1 answer

3

The correct way to enter the web is to focus / study these concepts?

Yes. It is always good to be up to date with new technologies. SPA means Single Page Application , is a new model of Web and mobile application development that has been gaining prominence in big companies like Microsoft, Google, Twitter, Facebook, etc. It basically means to code less in server-side and more in client-side . That is, the application will be contained all or almost entirely in the client (within the Web browser). It's pretty much a desktop application running under the browser.


Is it always feasible or when you can use SPA / Rest?

Everything has advantages and disadvantages.

  • Advantage:

    • Balancing responsibility for client-server execution
    • Less server code, and more responsibility on the client;
    • Enhance the user experience (UX) by creating an interface with modern usability and easy user understanding;
    • Lower bandwidth consumption because data loads are made on demand and by AJAX .
  • Disadvantage

    • Too much code JavaScript to manage in the browser, page load can be very slow (since you have to load and run a ton of JS). If you use a web server JavaScript as Node.js , you can partially solve the last two questions, making server-side same page.


In safety, is it safe to use a SPA?

According to this site , no. Because these types of applications are called "untrusted clients," since our server-side code has no control over the environment in which to run. Even regular web applications have these problems. People can easily change or inject JavaScript code on a page through the developer console. Mobile apps, such as those on Android and iOS, can be compiled and inspected. As such, you would not like to incorporate sensitive information such as secret keys or passwords on these types of clients.


References:

24.09.2016 / 19:38