Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

16.2 A Hypertext Document Server

A hypertext document can contain links to other documents, which can contain links to other documents, which can contain links to other documents and so on. All of the documents which can be accessed from a single root document are said to form a document web. For example, here's a picture showing the links in a simple four-document web:

Figure 13 -- Links in a simple four-document web

The root document, Reptiles, references documents about frogs and salamanders. Each of those documents, in turn, refers to the document called Slime.

Suppose you have two hypertext webs, each keyed by a string, as shown in Figure 14 and Figure 15.

There are two webs in this collection: one keyed by the string "ReptileWeb" and the other by "CircleOfLife." One way to represent this collection is as a Tools.h++ dictionary class such as, RWTValHashDictionary<RWCString,Web>. Of course, this would restrict access to the collection to a single process. Instead, we build a collection server, which is accessible from multiple client programs.

Figure 14 -- ReptileWeb web

Figure 15 -- CircleOfLife web

16.2.1 RWCollectable and Virtual Streams

One of the challenges in implementing the collection server is figuring out how to transmit a web between the client and the server. This is a tough problem: a web consists of multiple documents, each of which may be referenced multiple times, and we need to preserve these relationships across the transmission. As well, we have to deal with the normal problems of possibly incompatible data representation formats across potentially disparate client and server architectures.

Fortunately, we can leverage the Rogue Wave persistence machinery, along with the net library's Iostreams Module, to solve our data transmission problems.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.