The twin pattern is another interesting instance of Delegation. In simple terms, the pattern is about two objects aggregating each other symmetrically as shown in Fig. 8.11.

Fig. 8.11 The Twin pattern illustration
This is beneficial in some applications. Consider animating a ball object with a separate thread. A common approach is to manipulate the ball in a thread’s run method. However, we could create a pair of threads, one controlling pause and resume of ball movement while the other managing ball movement and drawing the ball as needed. By making them twins, one thread can access the operations of the other, making animations more interesting.
Another use of Twin is to gain some benefits of multi-inheritance in single-inheritance semantics. As shown in Fig. 8.11, through an aggregated instance of Child2, Child1 can access data fields of Parent2. In the same fashion, Child2 can access data fields of Parent1. If Child1 needs operations that are considered as overrides of some operations in Parent2, Child2 then can provide the overrides for Child1 to use. Thus, loss from direct inheritance can be partially recovered by using Twin objects. Type flexibility of multi-inheritance is not completely lost either. For example, if type Parent1 is expected, we use an instance of Child1, yet to access operations of Parent2 as if it were an instance of Parent2. Nonetheless, the Twin pattern provides only a workaround if multi-inheritance is not supported.
~
C. Hu, An Introduction to Software Design, doi , p. 248
See also Discover Twins