Web 2.0 applications have become popular as drivers of new types of Web content, but they have also introduced a new level of interface design in Web development; they are focusing on richer interfaces, user-generated content, and better interworking of Web-based applications. The current foundations of the Web 2.0, however, are strictly imperative in nature, which makes it difficult to develop applications which are robust, interoperable, and backwards compatible. Using a declarative approach for Web 2.0 applications, this new wave of applications can be built on a more robust foundation which is more in line with the Web’s style of using declarative methods whenever possible. We show a path how today’s imperative Web 2.0 applications can be regarded as a testbed as well as a first implementation for a revised version of Web 2.0 technologies, which will be based on declarative markup rather than imperative code.

Fueling the second wave of the Web’s popularity, the term Web 2.0 has become highly popular for describing a new breed of Web applications. It is mainly perceived to refer to two major areas, one being user-generated content and the social networks around it, and the other being a set of technologies providing support for richer interfaces for Web applications, bringing the user experience of Web applications closer to that of desktop applications.

In this paper, we refer to both areas; we argue that the contextual nature of Web 2.0 content needs a better representation, and we also argue that the same representation can be used to better describe the rich interfaces for applications building on that contextual content. Our claim is that a declarative way of representing Web 2.0 data provides benefits in various areas, overall leading to a Declarative Web 2.0, which is superior to the current Web 2.0 in terms of machine-readability and loose coupling. A declarative style of describing a task focuses on describing the task itself, rather than describing how the task has to be solved. While a declarative Web 2.0 represents core information in structured documents, the current Web 2.0 heavily relies on imperative principles, with a multitude of JavaScript libraries providing largely overlapping sets of functionality. Switching between these libraries is hard, because they use different APIs and underlying models and thus tightly couple user code with a particular library.

One of the main reasons why a declarative approach is preferable over imperative programming is that declarative languages provide a better foundation for versioning and extension, as demonstrated by the Web’s foundation, the Hypertext Markup Language (HTML). Because HTML is designed to tolerate versioning and extensions, older browsers can be used to render Web pages designed for newer Web browsers; they will render these pages as good as possible within the limitations of the older language.

One area where this issue becomes very visible is in the area of accessibility. While today’s rich Ajax applica- tions provide a much better user experience for most users, they often completely break down in cases where Ajax’s programming-oriented approach does not work, for example when Web pages should be rendered by voice browsers. Again, declarative approaches would be highly superior for this scenario, because a declarative application could be used by two very different clients, one being a visual browser with advanced interface capabilities, and the other being a voice browser, which still could access all relevant application information for rendering it.

Download pdf Declarative Web 2.0