jeudi 26 novembre 2015

A purely ajax-oriented front-end paradigm?

I am new to web development. I am considering a general working paradigm for front-end web pages as below:

enter image description here

  1. First, client will request server on some URL, and server will return a pure static HTML page to client. Note that this static HTML page MUST be readily wired up with CSS and Javascript. It may contain placeholders that will be filled later.
  2. Second, once the page is loaded in the client browser, a init() script will be invoked and send an AJAX call to the server's RESTful API. The server will respond some data to client for initial display. i.e. to fill the placeholders in step 1.
  3. Now client page is ready with all placeholders filled. Customer can view the page and perform activities on it. These activities can trigger ad-hoc AJAX calls to the server's RESTful API to get necessary data.

I think this paradigm has the following benefits:

  1. The initial response is quick because it is purely static HTML and no server-side process involved for the first request.
  2. No need to learn various detailed syntax such as JSP, Expression Language, scriptlet, etc.
  3. Simple development paradigm. Server side just need to provide a init() API and other business-related APIs, all RESTful.

Is this paradigm OK? Is there any limitations or flaws?




Aucun commentaire:

Enregistrer un commentaire