PATTERNS OF DATA MODELING- P9: Models provide the means for building quality software in a predictable manner. Models let developers think deeply about software and cope with large size and complexity. Developers can think abstractly before becoming enmeshed in the details of writing code. Although models are beneficial, they can be difficult to construct. That is where patterns come in. Patterns provide building blocks that help developers construct models faster and better. | Structured Tree Template 21 SELECT AS parentNodeID AS parentNodeName FROM Node AS Child INNER JOIN Branch AS B ON INNER JOIN Node AS Parent ON WHERE aChildNodeID Figure Structured tree SQL query. Find the parent for a child node. SELECT AS childNodeID AS childNodeName FROM Node AS Child INNER JOIN Branch AS B ON INNER JOIN Node AS Parent ON WHERE aParentNodeID ORDER BY Figure Structured tree SQL query. Find the children for a parent node. Sample Populated Tables Figure shows sample structured tree tables populated with data. The ID values are arbitrary but internally consistent. Examples Trees often arise in applications and sometimes the structured tree template is the best choice. Many drawing applications and user interfaces have the notion of a group. In Figure a DrawingObject is Text a GeometricObject or a Group. A Group has two or more lesser DrawingObjects the resulting recursion yields trees of DrawingObjects. Note the further refinement from Figure a group must include at least two DrawingObjects. Figure is the analog to Figure . Figure suffices if you merely need to record the reporting structure. In Figure a Person can be a Manager or an IndividualContributor. Except for the CEO each Person reports to a Manager. The management hierarchy can be arbitrarily deep. There are material differences between Managers and IndividualContributors necessitating the use of subtypes. For example only Managers can be in charge of Departments. Many years ago the original Microsoft PC-DOS file structure was a hierarchy. Each file belonged to at most one directory. Modern operating systems permit files to belong to multiple directories as the next chapter explains. In Figure a File may be a DataFile or a .