next up previous
Next: 3. Patterns in Java Up: 2.3.3 Language support Previous: 2.3.3.2 Built-in Delegation.

2.3.3.3 Section summary.

In this section we have presented a scheme to simulate multiple inheritance and have demonstrated its application on various examples, shedding light on what can and cannot be achieved by the simulation. The ``pure Java'' simulation has been complemented by a discussion of possible language extensions that support forwarding-based designs.

Besides providing practical design patterns, our discussion demonstrates that asking for multiple inheritance in Java is not a good idea given that more powerful, dynamic alternatives are available. If the language should ever be extended to support conflict resolution, support for multiple delegation would be preferrable to adding multiple inheritance.

Similarly to Section [*], meta-level techniques can be used for simulating multiple inheritance and delegation [2]. However, these exhibit the same shortcomings with respect to type-checking and performance. Therefore we have confined ourselves to non-reflective approaches for approximating delegation and multiple inheritance.



T. K. Prasad