Next / Previous / Contents / TCC Help System / NM Tech homepage

7. Design notes

The data structure design for this application proceeds directly from the ERD discussed in the previous section. The generated Web pages are basically a taxonomic tree presented in outline form, with links to pages bearing all the photos of a single form.

Hence, the program will build a tree in which each node relates to a taxon, each taxon contains one or more forms, and each form contains one or more photos.

Here is the general flow of the program.

  1. Create an empty TaxonPhotoSet instance for the root taxon, Class Aves.

    This instance will form the root of a taxonomic tree of TaxonPhotoSet objects. This tree will contain only nodes for taxa for which there are photos.

  2. Using the index files named on the command line, work through all the archived, catalogued photos. Each photo may depict multiple forms: each form in the photo is added to the tree separately, once for each form name in the catalog entry. The photo's cataloging information is represented by an ArchImage object.

    When a photo is added under a given form name, we first find the taxon to which the form is referred. Then add TaxonPhotoSet nodes to the tree as necessary to form a path from the root down to the referred taxon—let's call this the leaf.

    Next we make sure that the leaf TaxonPhotoSet contains a FormPhotoSet object for the name we're adding. Then we add the photo to that FormPhotoSet.

  3. To generate the Web pages, we traverse the tree of TaxonPhotoSet objects in preorder, that is, starting with the root, and recursively visiting the children.

    Each TaxonPhotoSet node visited is rendered as a div element decorated with a class name appropriate to its taxonomic rank.

    If the node has photos for only one form, the taxonomic heading will itself be a link to the form page for that form. For taxa with multiple forms, however, each name appears on a separate line, each line a link to the form page for that form.

    In either case, the program builds the form page when it builds the link to that page. Each FormPhotoSet object corresponds to one form page. The bulk of the content of each form page is the table that displays the thumbnails and other photo data.