Overview
| A |
Consider the problem of listing all existing software. Softwares naturally falls into different categories. A simple example follows:
+ Linux
- Administrative
- Databases
- Publishing
o Latex
o Star Office
- Web
o Netscape
o Mozzilla
- Email
+ FreeBSD
+ Windows
+ VMWare
+ DOS
and so on. This can be conceptually visualised as a tree (a forest is by definition a bunch of unrelated trees), or as representing some kind of a file system. Each node (inode if you think interms of a file system) stores pointers which help us find the actual information. The actual information for each node is stored in static strings, and pointers to them (their s_str_id's) are stored with the node. This kind of hierarchical data cannot be stored in a relational database in a natural format. So we flatten this tree into a list and store it in the database. If you are thinking in terms of a filesystem, we are storing the the full path name of all the files in the filesystem in the database. This flattened information is enough for us to recontruct the tree (i.e. given the full path names of all the files, we can reconstruct the directory structure). The Forest Control implements this unflattening algorithm and also helps render this information in the form of a web page.

