Vertical, Horizontal, and Behavioural Extensibility of Software Systems
چکیده
Object-orientation often claims to support extensible and modular programming. By distinguishing three different dimensions of extensibility, howev er − vertical (extensions of the type hierarchy), horizontal (extensions of the spectrum of operations available on types), and behavioural (extensions or even modifications of the original behaviour of operations) −, it is shown that typical objectoriented programming languages support only one of them in a direct and modular way: vertical extensibility. Horizontal extensibility in a modular fashion can only be achieved indirectly by disciplined application of design patterns such as the Visitor pattern, while behavioural extensibility is not supported at all. On the other hand, a new and surprisingly simple concept called dynamic routines, that is introduced in this paper, simultaneously supports all three dimensions of extensibility in a natural and flexible way, thus eliminating the need for some clumsy design patterns and at the same time offering the programmer additional freedom. To make the concept immediately applicable in practice, it has been implemented as precompiler-based language extensions for C++, Oberon-2, and Java.