The class diagram in Figure 13-2 shows the major classes and relationships in the program. A treeMap class has public methods named Add and Get and holds a reference to a treeMapNode in a variable named topNode. Each treeMapNode holds a reference to two other treeMapNode instances in some kind of container named nodes. Each treeMapNode instance holds references to two other instances in variables named key and value. The key variable holds a reference to some instance that implements the IComparable interface. The value variable simply holds a reference to some object. Figure 13-2. Class diagram of treeMap
We'll go over the nuances of class diagrams in Chapter 19. For now, you need to know only a few things.
Look carefully at this diagram and relate it to the code in Listing 13-1. Note how the association relationships correspond to instance variables. For example, the association from treeMap to TReeMapNode is named topNode and corresponds to the topNode variable within treeMap. |