Thursday, February 11, 2010

Web UI Strategies: A Conceptual Take

From Rails to PHP, JSPs, ASPs, Flex, and straight up JavaScript, how do you choose a view technology for your RIA website?
Even within just the Java world, there is Tapestry, Stripes, Wicket, JSTL and JavaFX.
So where do you start? Find out what they mean at their core.
I see only 2 Web UI Strategies:

  1. Data first-View second
  2. View first-Data second




Data first-View second
(1st Generation Client-Server Strategy)
This is when you make a request, the server processes the request, comes up with all the data needed to populate the page and renders the page back to the client as HTML with the data in it.
i.e.

http://server/customer.page -> [Server side logic] -> fill in the template with data -> html on page

Examples:
PHP, ASP, JSP, JSTL, JSF, Tapestry, Freemarker, Wicket, Tiles, Sitemesh

Each of these views are Dynamically pieced together and Interpreted by the client browser at runtime.

The server mashes up the page layout with the data!

Think Run-time.


View first-Data second (2nd Generation Client-Server Strategy)
This is when you make a request, the server gives you a view that you download.
The view knows how to populate itself and makes a request to the server to do so.
i.e.

http://server/customer.page -> [Client downloads view from Server] -> html on page -> now fetch data from Server to fill it in

Examples:

Flex, Silverlight, JavaFX,
GWT, Generic Onload AJAX

Flex, JavaFX, and Silverlight are "sheltered" in their own runtime within the browser. Each of those 3 and GWT have a concept of getting precompiled, which aids in finding bugs earlier in the process. All make use of additional server requests after the fact to fetch the data. This idea of pushing data off until later, has been made possible with high-speed internet connections and more bandwidth where it is no longer a problem to make more HTTP trips to the server.

The view works standalone by itself with -or without- data!

Think Compile-time.

No comments:

Post a Comment