Figure 4: Bidirectional layout example
Figure 4 provides examples of bidirectional object layouts for two classes, CA and CB. These classes implement types A and B respectively. The methods and instance variables associated with each type or class are indicated in the diagram. For example, CA supports the methods a1 and a2 of its type A, and adds a private method c. It has one instance variable named va. The figure shows the layouts of objects and the dispatch vectors they point to. The dispatch headers for each of these classes contain a single dispatch vector, which is the class dispatch vector. Note that the CB. object is compatible with the CA object, which is necessary because CB inherits from CA.