Trees in Graph Theory
In a composite structure, we can say that a node that holds references to other nodes is a tree. However, this definition is a bit loose. To be more precise, we can apply a few terms from graph theory to object modeling. We can start by drawing an object model as a graph—a collection of nodes and edges—with objects as nodes and object references as edges.
Consider an object model of an assay, or analysis, of a batch of a chemical. The Assay class has a batch attribute of type Batch, and the Batch class has a chemical attribute of type Chemical. Suppose that a particular Assay object a has a batch attribute that refers to a Batch object b. Suppose too that the chemical attribute of the Batch object b refers to a Chemical ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access