The DejaVu framework -- a software architecture for Web components

Anton Eliëns, Jacco van Ossenbruggen & Bastiaan Schönhage
Vrije Universiteit, Department of Mathematics and Computer Science,
De Boelelaan 1081, 1081 HV Amsterdam, The Netherlands
email: {eliens,jrvosse,bastiaan}@cs.vu.nl, fax: +31.20.4447653

Introduction

A point of concern widely recognized in the Web-community is that with the increasing number of document formats, traditional monolithic browsers become too large and too inflexible to adapt to the need of individual users. In fact we believe that, with the general acceptance of the Web as a vehicle for information dissemination, traditional browsers will gradually be replaced by more finely-tuned Web-integrated applications.

In this paper we will present the DejaVu framework that allows for a component-based approach to developing Web-integrated applications.

The DejaVu framework

The DejaVu framework offers access to the Web as one of the facilities in a collection of software components for developing multimedia user interfaces and hypermedia applications. Based on extensions of the hush (hyper utility shell) library, it provides a vehicle for experimenting with true hypermedia extensions to the Web. Our approach, which is essentially object-oriented, allows for integrating the Web in applications and vice versa, for composing a Web browser with support for sound synthesis, digital video, 3D graphics and VR. On a software level this is realized by extending HTML to allow for embedded scripts, written in a script language that is extensible with application-defined functionality. Application-functionality written in C++ or C can be easily incorporated since hush allows for providing a script interface to such functionality. However, in addition to this rather low-level provision for active documents based on scripts, our Web browser component allows for SGML-defined document types (with associated style-sheets) capturing the syntax and semantics of multimedia extensions. Note that we have focussed exclusively on client-side solutions. A structured approach to server-side application development is described in  [Ladd95].

To realize the functionality of hush and its extensions, we employed some basic patterns  [GOF94] based on an improved version of the handle/body idiom that was originally introduced in  [Coplien92].

The nested component pattern has been introduced to support the development of compound widgets. It allows for (re)using the script and C++ interface of possibly compound widgets, by employing explicit redirection to an inner or primary component. Every (compound) widget can delegate part of its functionality to an inner component. It is common practice to derive a compound widget from another widget by using interface inheritance only, and to delegate functionality to an inner component by explicit redirection.

The actor pattern provides a means to offer a multitude of functional modes simultaneously. For example, a single kit object gives access to multiple (embedded) script interpreters, as well as (possibly) a remote kit. The pattern is essential in supporting the multi-paradigm nature of the DejaVu framework. In our description of the design of the Web components we will show how dynamic role-switching (the actor pattern) is employed for using various network protocols via the same client class. The actor pattern is also used to define a (single) viewer class that is capable of displaying documents of various MIME types (including SGML, HTML, VRML).


The Hush Web Components

The figure above shows the design of the basic Web-related components of the hush class library. The browser class provides the toplevel user interface for all Web components, including a viewer, scrollbars, navigation buttons (back, forward, home, reload) and an entry box to enter URLs. The client, web and viewer components form the conceptual base of our approach of viewing the Web. Each component can be extended in a simple way, due to a systematic application of the patterns discussed previously.

Multiple viewers are accessible via the MIMEviewer which employs the actor pattern to be able to display various types of MIME-encoded data (e.g. HTML, SGML combined with Tcl style sheets, VRML). The viewer contains a dictionary of several viewer actors, that are indexed on their associated MIME type. In this way, new viewers can be easily added, even dynamically. The viewer implementation classes can make use of existing widgets to display parts of structured documents, which simplifies their implementation. Another advantage of this design is the fact that whenever a viewer for a new MIME type has been added, it is possible to inline this data type in an SGML or extended-HTML document, via recursive usage of a viewer widget in another viewer. In other words, it is possible to inline VRML or video into an HTML document, or even to insert an HTML-page into another HTML-page. The SGML viewer uses an SGML-compliant validating parser  [Clark95] and an (experimental) style sheet mechanism based on the Tcl scripting language. This approach allows for experimenting with new (multimedia) document formats. Since the viewer provides no network functionality at all, it generates an event whenever it needs to retrieve data pointed to by a URL. Such events are generated as a response to user interaction (e.g. clicking an anchor) or to fetch inline data during the parsing process. These events (realized by the hidden urlevent class) are typically handled by a web component.

The client component provides an abstraction of network (file) access and transport protocols. An important consideration in the design of this component was the requirement to allow for new network transfer protocols. This requirement has been met by employing the actor pattern. The client component implicitly changes its role, depending on the protocol required for fetching the data. When the client component gets the instruction to retrieve a URL, it inspects the URL, decides what role it needs and switches to the appropriate role.

The web component combines the functionality of the viewer and client components. It is able to follow links by retrieving data via several protocols (e.g. HTTP, files, FTP), a task delegated to its client component. Additionally, the web component adds a history and caching mechanism to the MIMEviewer. The web widget uses the nested component pattern described previously. This means that web inherits the interface of the MIMEviewer and delegates its (viewer) functionality to an inner viewer component. The web component's behavior is similar to the standard widgets of the framework, and can be conveniently used as a part of an application's GUI. Because the web widget has both a C++ interface and a Tcl interface, it is easy to create Web-aware applications, that is applications with Web functionality built-in.

Since viewers can be nested to arbitrary depth, any combination of viewers may be employed for inlining a variety of data formats in a uniform fashion. In particular, the combination of an SGML-aware viewer and style-sheets provides a solid starting point for discovering suitable high-level abstractions for integrating multimedia and advanced linking support in the Web.

Discussion

We think that there will be a transition from general purpose monolithic Web browsers to more finely-tuned Web-integrated applications adapted to the need of individual users and user communities. The DejaVu framework has been developed to support such a transition in a document-centered way.
Clark95
James Clark, SP --- An SGML parser, 1995 October 1.0.1, Available at >http://www.jclark.com/sp.html
Coplien92
J. Coplien, Advanced C++ Programming Styles and Idioms, Addison-Wesley (1992)
Doorn95
M. van Doorn and A. Eliëns, Integrating WWW and Applications, Proc. of the 3th Int. World Wide Web Conf. -- Technology, Tools and Applications, Computer Networks and ISDN systems, Vol 27. No 6, Elsevier, 1995, pp. 1105-1110, Also at >http://www.igd.fhg.de/www/www95/proceedings/papers/48/main.html
Eliens95a
A. Eliëns, Principles of Object-Oriented Software Development, Addison-Wesley (1995)
Eliens95b
A. Eliëns, Hush -- a C++ API for Tcl/Tk, The X Resource, Issue 14, April 1995, pp. 111-155
GOF94
E. Gamma, R. Helm, R. Johnson and J. Vlissides, Design Patterns -- Elements of reusable object-oriented software, Addison-Wesley (1994)
Ingham95
D. Ingham, M. Little, S. Caughey, S. Shrivastava, W3Objects: Bringing Object-Oriented Technology to the Web, Proc. of the 4th Int. World Wide Web Conference '95 -- The Web revolution, World Wide Web Journal, O'Reilly and Assoc., Inc., pp. 89-105
ISO95
ISO/IEC, Document Style Semantics and Specification Language (DSSSL), 1995 DIS 10179.2
Gosling95
J. Gosling and H. McGilton, The Java(tm) Language Environment: A White Paper Sun Microsystems, available at >http://java.sun.com/whitePaper/java-whitepaper-1.html
Ladd95
D.A. Ladd and C. Ramming, Programming the Web: An Application-Oriented Language for Hypermedia Service Programming, Proc. of the 4th Int. World Wide Web Conference '95 -- The Web revolution, World Wide Web Journal, O'Reilly and Assoc., Inc., pp. 567-585
Ossenbruggen94
J. van Ossenbruggen and A. Eliëns, Music in Time-based Hypermedia, Proc. European Conference on Hypermedia Technology 1994, pp. 224-227
Ossenbruggen95
J.R. van Ossenbruggen and A. Eliëns, Bringing Music to the Web, Proc. of the 4th Int. World Wide Web Conference '95 -- The Web revolution, World Wide Web Journal, O'Reilly and Assoc., Inc., pp. 309-314, Also at >http://www.w3.org/pub/Conferences/WWW4/Papers/143/
Rees95
O. Rees, N. Edwards, M. Madsen, M. Beasley and A. McClenaghan, A Web of Distributed Objects, Proc. of the 4th Int. World Wide Web Conference '95 -- The Web revolution, World Wide Web Journal, O'Reilly and Assoc., Inc., pp. 75-88
Rossum95
G. van Rossum, Python, See >http://www.python.org/
Sperberg94
HTML to the Max --- A Manifesto for Adding SGML Intelligence to the World-Wide Web, C. M. Sperberg-McQueen and Robert F. Goldstein, Proc. of the 2th Int. World Wide Web Conference '94: Mosaic and the Web 1994 October