Alternative Generic Libraries

 

Zoltán Porkoláb, Róbert Kisteleki

gsd@ludens.elte.hu, kistel@caesar.elte.hu

Dept. of General Computer Science, Eötvös Loránd University, Budapest

Pázmány Péter Sétány I/D, Budapest, Hungary, H-1117

 

Nowadays, new object oriented based paradigms came into view of which one of the most interesting is generic programming. The goal of this style is to reveal the foundations and programming methods of generic and therefore reusable components and libraries. Using this approach we can greatly simplify the creation of a software library. For example, if we have a library with n data structures, each with k base type and m algorithms, then using the traditional methods we would have to implement O(k*n*m) methods. Using generic programming this means only O(n+m) functions or procedures.

The software library designs that have resulted from this generic programming approach are markedly different from other software libraries: The precisely-organized, interchangeable building blocks that result from the approach permit many more useful combinations that are possible with more traditional component designs. The design is also a suitable basis for further development of components for specialized areas such as databases, user interfaces, and so on.

By employing compile-time mechanisms and paying due regard to algorithms issues, component generality can be achieved without sacrificing efficiency. This is in sharp contrast to the inefficiences often introduced by other C++ library structures involving complex inheritance hierarchies and extensive use of virtual functions.

The bottom-line results of these differences is that generic components are far more useful to programmers, and therefore far more likely to be used, in preference to programming every algorithmic or data structure operation from scratch.

On the other hand, generic programming has only one well-known existing implementation: the C++ Standard Template Library (STL). Because in any implementation, the elements of the general principles and the particular programming language inevitably blend, one implementation is not enough to examine the structure of generic libraries and programming.

GTL library

Our goal is to examine the deeper meaning of generic programming. During this work, we designed and implemented a demonstrative template library. This library is the GTL, Graphical Template Library, which manipulates n graphical objects with m generic functions in similar way as STL does it. Implementing GTL we try to determine the structure and elements of the general software libraries. This allowed us to separate some of the general characteristics of general programming libraries from the elements used because of the particular library goals and implementing techniques.




Back to the GCSE Young Researchers Workshop Abstracts Overview.



Zoltán Porkoláb
Róbert Kisteleki
Last modified: Wed Sep 15 17:52:06 MEST 1999