A full-blown application

In this chapter we will describe in a step-by-step fashion how to build a full-blown application in C++. The application is called WET (WWW Exploring Topologizer) and its purpose is to explore a neighbourhood of a given URL in the World Wide Web and to output it in the shape of a graph. This application can be used to trace website maps or relations between websites (which often underline relations between the corresponding corporations); see for examples the maps of the IEEE (Fig. 5.1) and PSA (Fig. 5.2) websites.

Figure 5.1: The IEEE website map.
% latex2html id marker 4014
\includegraphics[width=13cm]{www.ieee.com.eps}

Figure 5.2: The PSA website map.
% latex2html id marker 4018
\includegraphics[width=13cm]{www.psa-peugeot-citroen.com.eps}

We delegate graph visualization to the GraphViz library www.graphviz.org, and in particular to the dot and neato UNIX utilities. These accept the input graph in a particular format

digraph graphName {
# list of nodes with special properties
  0 [ label = "thenode", color = red ];
# list of arcs
   0 -> 1;
   1 -> 2;
}
So the task performed by WET is to download a given URL and explore its links up to the $ n$ -th recursion level, then to put the obtained graph in the above format.

This chapter starts with a section on the software architecture; each class is then described and its implementation mostly delegated as exercise. The software architecture section does not contain any exercises, but it is a prerequisite for understanding what follows. Moreover, it is a (crude) example showing how to formalize the architecture of a software.



Subsections
Leo Liberti 2008-01-12