Beyond AJAX and HTML... a new approach!


XML & Web services: Beyond AJAX and HTML... a new approach!

  1. Beyond AJAX and HTML... a new approach! (1 messages)

    For reducing internet traffic and improving the GUI, client-side caching is the right idea, but using AJAX + HTML is not the best way for that.

    Using unstable JavaScript + savage HTML + amazing XML is a poor solution for internet users, and a lot of headache for web developers. We really need robust environments and standard well-designed frameworks. Current HTML is not a good markup language for caching.

    The solution:

    To give a powerful approach for caching techniques, here are some ideas:

    I - We need to replace HTML with a smarter XML-based presentation markup language. This new ML would have the following features:

    1. Elements like:
         ELEMENT URI="..."
    This allow us to cache and refresh the ELEMENT element, the same way images are cached and refreshed by browsers. Our ELEMENT would be written in a separate file, and a web page would be a puzzle of separate files. This method may increase the number of HTTP requests for a web page download (a HTTP request for each separate file), but this would prevent re-loading the same ELEMENT element for another web page.

    2. There could be a method to reduce the number of HTTP requests for web page downloads (which will be mentioned later in this message).

    3. Our new ML code would also have elements like:
    A HREF="..." TARGET="..."
    This looks like HTML code, but the difference is that the TARGET attribute wouldn't contain values like "top" or "parent". It would rather contain a XPath expression (or a DOM path) which specify an element to be replaced, by the element which is specified by the URI of the HREF attribute. This method would be very useful, for example, for expanding/collapsing a tree item).

    4. Our new ML could integrate both Swing-like components and HTML-like components in the same web page.

    II - We also need client-side scripts written in pure Java, not JavaScript (this will make Java evangelists very happy!) These pure Java scripts could use XPath, DOM... etc to handle the elements of our ML.

    This way, Integrating JSF-like web frameworks with our caching approach also would be easier (since server-side and client side are both written in Java). Further more, developpers even wouldn't need to write twice the input validation code (one time for the server and another time for the client). The client would rather receive and cache a copy of the existing server-side pure Java validation code.

    As for reducing the number of HTTP requests, imagine a web server which can send the web page with all its related files (like images) in only one server response, rather than waiting for the client to ask for these files. In addition, to download the web page, the request message would specify the already-cached componets not to be re-loaded. Then, We would also need a new tier beyond our old HTTP protocol.

    The answer is definitely: Java + XML + XSLT + a new ML, instead of: JavaScript + XML + HTML. But is there any project which take into account all these ideas? Are there any band of developers who are interested in re-inventing a better wheel?

    Ahmed ALEM
    <alem_info at yahoo dot fr>
  2. Beyond AJAX and HTML... a new approach![ Go to top ]

    Great Idea.
    But can you state the differences between this model and the model (Java+XHTML+XML)?
    Thank you

    Ahmed Hashim
    Software Engineer
    Egypt Java User Group