Friday, December 2, 2011

Mobile Applications with HTML5 and CSS3

The pendulum swings:  it seems like web application development has been a square peg in a round hole for a while now.  We want highly interactive, user responsive web applications that feel like desktop applications.  We want separation of business logic from presentation tier.  We use JSP, ASP or JSF to act as the intermediary between the client and business tiers (take in html, process and emit html).  The HTML spec was written in a request/response paradigm which is hardly interactive and responsive.  So we add on Javascript to give web sites some interactivity.  And from here the worm begins to turn......

Javascript evolved from a tool marketers could use to add some sizzle to a web site, into a full fledged framework for control of the browser.  With CSS3, you can take advantage of local hardware to perform faster renderings than the browser could do alone.  All this makes me wonder if the JSP, ASP or JSF paradigms work in mobile phone development since they are both server side templating and emission of HTML.  With more advanced HTML and Javascript specs, could the browser really BE the templating and emission of HTML tool?  Could you just use the server to accept, emit and validate data via JSON/XML or whatever?  Would that allow the browser to store the data in local cache for later use, like when you get off the airplane or finish a phone call?  If this approach is good for the phone, then why not the desktop user?  Could web applications be written using HTML/JavaScript and JSON -- with a Spring, JEE or .NET stateless service handling get/post requests?

I don't know the answer.  It seems to me that the HTML spec may be missing some necessary templating rules to make that happen, i.e it would be nice to have a site format with top/left nav and footer applied to all pages.  Wait!  isn't that CSS' job.  What about large data, like images or content from a CMS?  The browser does a good job of caching these things locally already.

As browsers advance in efficiency and capability, and W3C has finally started to move the HTML/CSS specs forward, Maybe it's time to rethink the paradigm.